Way for Fixtures to delete only entity data

Bug #504335 reported by Jim Menard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Undecided
Unassigned
1.1
Fix Committed
Undecided
Unassigned

Bug Description

Fixtures.deleteAll() deletes data from all tables, not just tables that are associated with JPA entities. I'd like to request that it only delete data from JPA Entity (Model) tables.

Revision history for this message
Jim Menard (jimm-io) wrote :

21d20
< import javax.persistence.Entity;
33d31
< import play.classloading.ApplicationClasses;
110,116d107
< public static void deleteAllEntities() {
< List<Class> classes = new ArrayList<Class>();
< for (ApplicationClasses.ApplicationClass c : Play.classes.getAnnotatedClasses(Entity.class))
< classes.add(c.javaClass);
< Fixtures.delete(classes);
< }
<

Revision history for this message
Jim Menard (jimm-io) wrote :

If it's not obvious, the patch above os for Fixtures.java. It creates a new method called Fixtures.deleteAllEntities() that only deletes data in tables associated with classes marked with the @Entity annotation.

Revision history for this message
Guillaume Bort (guillaume-bort) wrote : Re: [Bug 504335] Re: Way for Fixtures to delete only entity data

Ok thank you.

On Thu, Jan 7, 2010 at 6:28 PM, Jim Menard <email address hidden> wrote:
> If it's not obvious, the patch above os for Fixtures.java. It creates a
> new method called Fixtures.deleteAllEntities() that only deletes data in
> tables associated with classes marked with the @Entity annotation.
>
> --
> Way for Fixtures to delete only entity data
> https://bugs.launchpad.net/bugs/504335
> You received this bug notification because you are subscribed to play
> framework.
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.