I am having a project in which i have used jpa+hibernate. I am having a persistence.xml file and want it to create the tables in the database automatically.I have specified all the properties correctly. In the log it shows all the sql statements but still in the database there are no tables. Does anyone have a solution for this problem I have searched almost all the links related to my problem but nothing worked.
Here is my persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="pl4sms-persistence" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.ecomm.pl4sms.persistence.entities.SampleBatch</class>
<class>com.ecomm.pl4sms.persistence.entities.SampleMessage</class>
<properties>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/samplejpa"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="root"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>
This is what i get on console
16:35:48,881 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 23) HCANN000001: Hibernate Commons Annotations {4.0.4.Final} 16:35:49,069 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 23) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 16:35:49,084 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 23) HHH000431: Unable to determine H2 database version, certain features may not work 16:35:49,225 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 23) HHH000397: Using ASTQueryTranslatorFactory 16:35:49,537 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 23) HHH000227: Running hbm2ddl schema export