How can I map object to materialized view and keep <prop key="hibernate.hbm2ddl.auto">validate</prop>
?
When launch webapp, I get this exception on startup:
Caused by: org.hibernate.HibernateException: Missing table: subjects_lp
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1302)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:512)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1797)
...
According to sources, it looks like hibernate asks only for types "VIEW" and "TABLE" in DatabaseMetadata#getTableMetadata, while postgresql stores it like "MATERIALIZED VIEW" (checked with plain jdbc).
Surprisingly, I couldn't find in google some info about this error. Is there way to keep hibernate validation on startup, maybe there is way to keep one table/entity unvalidated?
Hibernate version: 4.2.12.Final
Postgresql driver: 9.3-1101-jdbc41
Entity doesn't have any specific annotation, only
@javax.persistence.Entity
@javax.persistence.Table(name = "table_name", schema = "schema")
It's not a driver problem, it's a hibernate bug.
See this bug https://hibernate.atlassian.net/browse/HHH-9602
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With