users@glassfish.java.net

Drop and Create policy in persistence.xml does not drop SEQUENCE and others

From: <glassfish_at_javadesktop.org>
Date: Thu, 09 Sep 2010 01:49:25 PDT

Netbeans 6.9
glassfish-3.0.1
EclipseLink(JPA2.0) (eclipselink-2.0.2.jar, eclipselink-javax.persistence-2.0.jar)

I have an abstract base @Entity Element with:

  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;

I have inheriting @Entity classes Activity and Actor.

There is an @ManyToMany between Activity and Actor with a @JoinTable (name="ACTIVITY_ALLOCATEDTO_ACTOR" ..)

I find the following automatically generated tables are not dropped on redeploying my application, giving rise to a warning that they already exist and then resulting errors:

SEQUENCE,
ELEMENT
ELEMENT_ELEMENT
ACTIVITY_ALLOCATEDTO_ACTOR

I have to explicitly delete these 4 tables (using the Netbeans Services->Databases) "by hand", restart the Glassfish server, and then rerun/redeploy my app each time I make a change to the developing entity structure.

Q: How can I set the persistence.xml policy to also automatically drop these 4 tables ?
[Message sent by forum member 'webelcomau']

http://forums.java.net/jive/thread.jspa?messageID=482157