views:

281

answers:

1

I can use MySQL views in Hibernate by treating them like tables - ie. the entity is no different than one created for a table. However my application won't deploy when Hibernate is set to validate the model as it can't find the View as it assumes it's a table.

Is it possible to use Hibernate Entities with deploy time validation turned on (hibernate.hbm2ddl.auto = validate)?

Thanks.

+2  A: 

There are several issues in JIRA about this (HHH-2018, HHH-1872, and HHH-1329) so this might clearly be a new one. My understanding is that the easiest workaround for now is to turn hbm2ddl off. If you think that your case is not covered by the existing issues (e.g. because you are using MySQL), maybe open a new one.

Pascal Thivent
Thanks. Good to know. I had searched the Hibernate JIRA / Google but "view" is a hard word to search on.
Damo
Hot to turn of hbm2ddl?
Alex