How can I change column length using HQL query?

Posted by gmugmu on Stack Overflow See other posts from Stack Overflow or by gmugmu
Published on 2010-05-17T05:44:37Z Indexed on 2010/05/17 5:50 UTC
Read the original article Hit count: 180

Filed under:
|
|
|

I tried session.createSQLQuery("ALTER TABLE People MODIFY address VARCHAR(1000);").executeUpdate();

but this throws org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query

After a lot of googling, the recommendation is to use HQL instead of SQL query to do bulk updates. Not sure how to use HQL to accomplish this. There seems to be no decent HQL documentation for updating column length in a table.

Thanks so much for the help.

© Stack Overflow or respective owner

Related posts about hql

Related posts about schema