mirror of https://github.com/apache/openjpa.git
Example of how to do dynamic class registration in OpenJPA.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@596958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4fb39b9590
commit
21ec161339
|
@ -42,12 +42,14 @@ public class TestDynamicClassRegistration
|
|||
emf = createNamedEMF("empty-pu");
|
||||
}
|
||||
|
||||
public void testEnhancedDynamicClassRegistration() {
|
||||
public void testEnhancedDynamicClassRegistration()
|
||||
throws ClassNotFoundException {
|
||||
assertTrue(
|
||||
PersistenceCapable.class.isAssignableFrom(SimpleEntity.class));
|
||||
|
||||
// trigger class initialization
|
||||
new SimpleEntity();
|
||||
// trigger class initialization. We could just do 'new SimpleEntity()'.
|
||||
Class.forName(SimpleEntity.class.getName(), true,
|
||||
getClass().getClassLoader());
|
||||
|
||||
ClassMetaData meta =
|
||||
JPAFacadeHelper.getMetaData(emf, SimpleEntity.class);
|
||||
|
|
Loading…
Reference in New Issue