I think, therefore I blog

Drop-and-create-tables in OpenJPA

By , 6 March 2008

Drop-and-create-tables in OpenJPA

Toplink had a useful drop-and-create-tables options which made unit testing a lot easier because you always new you were testing a fresh database. Well, I've been trying to do the same thing in OpenJPA and couldn't figure it out until I found this JIRA issue: OPENJPA-94.

The nearest equivalent in OpenJPA is the following obscure setting:


It is actually faster than the Toplink method because the tables aren't recreated, they are just updated and emptied. It'd just be nice if it had a sensible name, and appeared in the docs somewhere!

Drop-and-create-tables in OpenJPA

About Roger Keays

Drop-and-create-tables in OpenJPA

Roger Keays is an artist, an engineer, and a student of life. Since he left Australia in 2009, he has been living as a digital nomad in over 40 different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, and finding good food. Click here to subscribe to his weekly blog, or stalk him on Facebook and Twitter.

Leave a Comment

Please visit https://RogerKeays.com/blog/drop-and-create-tables-in-openjpa to add your comments.

Join Over 1000 Subscribers

I write every Sunday about travel, psychology, and technology. Thousands of people just like you have already subscribed—and for good reason. It'll change your life. And it's free :)

Read a Good Book

“A spellbinding true story of love, passion and adventure. One can’t help but be swept away by 100% Love Guaranteed.” —Dr Tammie Matson, author of Elephant Dance.

Chat For A While

Your Vote Matters

Which animal will take over when humans go extinct?