3

I use Eclipselink 2.3.2 and want to know, if there is an way to exclude a single table/entity to be excluded from ddl-generation strategy drop-and-create-tables? I need to preserve the content of this table, while all other tables should be droped and been created complete new.

The reason is that the domain model is under heavy development so there are changed all and everywhere. But one single table (containing postal codes) should be preserved, because they are needed for development, and it takes to long to insert them all at every server start.

I know one way is to use two different persistence units. But this would cause some other trouble, so this not my preferred way.

Summary: Does anybody know a way to exclude a single table from droping while all other tables get droped and been recreated at each server start with ecliselink 2.3.2 (and Glassfish 3.1.2 )?

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
Ralph
  • 118,862
  • 56
  • 287
  • 383

1 Answers1

0

No easy way, other than using two persistence units, and perhaps composite persistence units.

You could add a dummy table with a constraint to the table you want to keep, then the drop will fail.

James
  • 17,965
  • 11
  • 91
  • 146