开发者

How to use the eclipse Hibernate Tools with grails and MySQL

I've 开发者_StackOverflowmanaged to connect from eclipse Hibernate Tools to my MySql Database used with grails, classes mapped by GORM.

Now I'd like to perform HQL queries on the DB using the Hibernate Tools. However Hibernate Tools tells me for every table that it is not mapped.

My question: Do I really need to write all the class mappings manually into a hibernate.cfg.xml file or is there a way to get it from grails? I mean grails / GORM needs to have an idea about the mappings, right? Or am I going for this the wrong way?

P.S. I know there is a script grails-create-hibernate-cfg-xml, but this only creates a dummy file for some Books class...


Grails has convetions based config so there is no hibernate.cfg.xml but you can easily execute HQL queries int groovy console - just call

grails console

It will open Groovy console connected to your app so you can write groovy scripts interacting with your DB.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜