This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 82173 - Hibernate Table Generation Strategy Should Be "update" for Create
Summary: Hibernate Table Generation Strategy Should Be "update" for Create
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Libor Kotouc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-08 14:58 UTC by William Leonard
Modified: 2006-09-06 10:00 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Leonard 2006-08-08 14:58:05 UTC
When the Persistence Provider is Hibernate and the Table Generation Stragegy is
"Create", the "hibernate.hbm2ddl.auto" property value should be "update". It's
currently set to "create", which causes the table to be re-created everytime the
application is deployed. "update" will property create the table if it does not
exist.
Comment 1 Libor Kotouc 2006-09-04 15:33:08 UTC
The sugested solution seems like hack for me. User might want to set create, not
update.
IMHO better solution is to add new property for update option and show this
option in the PU dialogs (the wizards for DS/JDBC and the visual editor). The
question is whether there should be this option shown for each persistence
provider (disabled if it is not supported) or whether we should show only those
options which are supported.
It involves a UI change, could someone from HIE comment?
Comment 2 William Leonard 2006-09-05 18:06:00 UTC
I disagree. It's just semantics. Hibernate uses the property value "create" for
our UI option, "Drop and Create". Hibernate used the property value "update" for
the UI option "Create".

UI ==> Hibernate mapping property value
Create ==> "update"
Drop and Create ==> "create"
None ==> ""

What other UI option would you add?
Comment 3 Libor Kotouc 2006-09-06 09:42:59 UTC
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html

...here I found that create/update/create-drop are all legal values with a
slightly different meaning. But I am ok with the change if you think that
"update" is more likely what the users want to get from the wizard/editor than
"create".
Comment 4 Libor Kotouc 2006-09-06 10:00:52 UTC
Fixed.

Checking in HibernateProvider.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/provider/Attic/HibernateProvider.java,v
 <--  HibernateProvider.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
done