1

When I'm creating the Hibernate application for first time and in the cfg.xml file, declared property hbm2ddl.auto as update , but it is still creating table instead throwing Exception "Table/View does not exits"

property name="hbm2ddl.auto" update

As per the value "update", if the table is already exits it has to update the data and it should not create the table in the DB(oracle).

But , in my case I declare "update" and no table exists in the DB but creating the table instead throwing Exception.

Can any one suggest me on this.

2 Answers2

0

The value of "update" still updates the schema (and will keep creating your table). Removing hibernate.hbm2ddl.auto entirely will probably accomplish what you're looking for.

Check out this guy for more info on the other values: Hibernate hbm2ddl.auto possible values and what they do?

Community
  • 1
  • 1
Dean Clark
  • 3,770
  • 1
  • 11
  • 26
  • 1
    I agreee, by removing hbm2ddl.auto we can achieve but my concern is if the value is update it should not create the table in the DB then why it is still creating the table in the DB? – suresh sadanala Apr 24 '16 at 16:52
0

If you want Hibernate to do nothing to your schema, set hbm2ddl.auto to none.

yglodt
  • 13,807
  • 14
  • 91
  • 127