Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » JPA Error when new entity is added without DropAndCreate
JPA Error when new entity is added without DropAndCreate [message #878336] Tue, 29 May 2012 01:27 Go to next message
Eclipse UserFriend
I am developing a J2EE application with JSF, EclipseLink2 as JPA installation and mySQL as the back-end database with Netbeans. Application works fine except when I add new attributes to existing entities, or create new Entities. If I select the dropandcreate option in Persistance.xml file, the application runs again without errors, but it deletes the whole data base with previous entries. When I go to production, I can not afford to lose data of the database when I add a new entity. Is there any way to overcome this. I tried to use a database schema, but could not figure how to do it. Thanks in advance
Re: JPA Error when new entity is added without DropAndCreate [message #878522 is a reply to message #878336] Tue, 29 May 2012 09:29 Go to previous messageGo to next message
Eclipse UserFriend
If you use create-tables instead of drop-and-create-tables then it will not delete your data. In production, you should probably remove the schema generation entirely as you will already have the production database defined.

EclipseLink 2.4 will also add a create-or-extend-tables option.
Re: JPA Error when new entity is added without DropAndCreate [message #878536 is a reply to message #878522] Tue, 29 May 2012 09:47 Go to previous message
Eclipse UserFriend
I want to add attributes to existing entities, but when I use create option, it add new entities, but do not add new fields to existing tables. I can not assure 100% that there will be no possibility to add a new attribute during the production phase. So best thing is to wait till EclipseLink 2.4 is available. Will it allow adding new attributes will be update the database with new fields without deleting existing data? When will it be released?
Previous Topic:eclipselink 2.4 mongodb with criteria api
Next Topic:[SOLVED] How to register pre/post refresh callbacks on an entity?
Goto Forum:
  


Current Time: Sat Jul 12 07:32:45 EDT 2025

Powered by FUDForum. Page generated in 0.03108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top