How do I get the Hibernate Configuration after the EntityManagerFactory has been built?

My web framework (Play 1.2.5) creates an EJB3Configuration local to a method which it uses to create an EntityManagerFactory (source). I am working on a script and would like to run the generateSchemaUpdateScript() method from Configuration to make SQL scripts I can verify and run on production deploys. The problem I am having is that I cannot figure out how to access the Configuration object that was used or how to generate a Configuration object after the EntityManagerFactory has been built.

Answers


You cannot get the configuration object back from the entitymanagerfactory because hibernate implementation EntityManagerFactoryImpl does not hold a reference to the configuration object

Your choices are

  • duplicates the code from JPAPlugin in your script to create your own configuration object
  • configure hibernate tools to work on your classes. I never used this tool myself but I guess that properly configured he can generate the ddl for you
  • generates back the ddl script from your database

Need Your Help

How to horizontally scroll an inner div with text wrapping

css html scroll

I am trying to get a series of inner divs to scroll horizontally inside a fixed width outer div. I have it working but the only problem is the text in the inner div does not wrap and overflows the...

What do WinDbg mean by External fragmentation?

c++ debugging heap windbg

I have a problem dealing with bad_alloc. It is thrown during a std::vector.push_back when it tries to reloc and allocate 2Mb

How to get all parameter choices in Revit?

c# parameters revit revit-api

There is an element's parameter that has like 5 choices (combobox's style). I know how to get the current selected one, but is there a way to retrieve the 4 other choices?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.