hbm2ddl.auto is not creating schema automatically when set to create

123 views Asked by At

I have set hbm2dll.auto property to create in my configuration file.

<property name="hibernate.hbm2ddl.auto">create</property>

Whenever I create SessionFactory it drops the table if already created but it is not recreating the table causing my program termination with this exception:

java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

Is it because of some database permission issue? I am using Oracle 11g as databse.

UPDATE: Hibernate configuration file

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@host:port:database</property>
        <property name="hibernate.connection.username">username</property>
        <property name="hibernate.connection.password">password</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
        <property name="hibernate.default_schema">myschema</property>
        <property name="show_sql">true</property>
        <property name="hibernate.hbm2ddl.auto">create</property>
        <mapping class="com.vat.annot.user.DBUser"></mapping>

    </session-factory>
</hibernate-configuration>
0

There are 0 answers