Can you specify to not create an Entity as a table when auto-create is set?
hibernate, jpa, spring
Solution
If you mark it as an entity then hibernate will always try to make the table if the hibernate.hbm2ddl.auto property is set to update, create-drop, or create. To stop this, get rid of this setting in your config file.
As Kevin pointed out these options are supposed to only be used during the developement phase or really bad things could happen to your prod db. Be sure to remove them before deploying there.
Check out the hibernate docs for more information
http://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/session-configuration.html
Problem
I have an application that uses Hibernate 4.1 and Spring 3.1.1. I am using Spring's HibernateJpaVendorAdapter and setting generateDdl to true to create the entities. I just created a View and created an Entity to map to that View. The Entity for the view is annotated with @Entity, @Table(name="ViewName") and @Immutable. When I deploy the web app it automatically creates tables for all Entities which creates a table for the entity that is supposed to map to my View. I have to go in and manually drop that table and then create the view. While I could continue to do this I wanted to know if there was a way to specify to not create a table for that particular "View" Entity.