[jboss-user] [EJB3] - Persistence provider creating new table even with update option
Mitesh pandey
do-not-reply at jboss.com
Thu Aug 11 13:23:54 EDT 2011
Mitesh pandey [http://community.jboss.org/people/mtshpandey] created the discussion
"Persistence provider creating new table even with update option"
To view the discussion, visit: http://community.jboss.org/message/620678#620678
--------------------------------------------------------------
Hi All,
I am using hibernate as my persistence provider and postgre as my DB.
My persistence.xml looks like below
<persistence-unit name="titan" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:PostgresDS</jta-data-source>
<class>com.domain.Cabin</class>
<class>com.domain.Customer</class>
<class>com.domain.Address</class>
<properties>
<property name="hibernate.dialect" value= "org.hibernate.dialect.PostgreSQLDialect" />
<property name="*hibernate.hbm2ddl.auto*" value="*update*" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/Entity"/>
<property name="hibernate.connection.username" value="*****"/>
<property name="hibernate.connection.password" value="****"/>
</properties>
</persistence-unit>
I have table Cabin, Customer and Address under my table Entity. When i deploy my jar and start the server , again a new table is created as cabin, customer and address. :0 I thought with value = "update" for hibernate.hbm2ddl.auto, it should not create any table and should only update the data.
When i deleted the table from DB, then there was no table found message when the jboss is up. I don't want to duplicate the tables.
What could be the issue ?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/620678#620678]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110811/e3688b64/attachment.html
More information about the jboss-user
mailing list