use of org.eclipse.persistence.dynamic.DynamicType in project eclipselink by eclipse-ee4j.
the class MetadataProject method createDynamicClasses.
/**
* INTERNAL:
* Create the dynamic class using JPA metadata processed descriptors. Called
* at deploy time after all metadata processing has completed.
*/
public void createDynamicClasses(ClassLoader loader) {
if (!m_virtualClasses.isEmpty()) {
if (DynamicClassLoader.class.isAssignableFrom(loader.getClass())) {
DynamicClassLoader dcl = (DynamicClassLoader) loader;
// Create the dynamic classes.
Map<String, MetadataDescriptor> dynamicClasses = new HashMap<String, MetadataDescriptor>();
for (ClassAccessor accessor : m_virtualClasses.values()) {
createDynamicClass(accessor.getDescriptor(), dynamicClasses, dcl);
}
// Create the dynamic types.
Map<String, DynamicType> dynamicTypes = new HashMap<String, DynamicType>();
for (MetadataDescriptor descriptor : dynamicClasses.values()) {
createDynamicType(descriptor, dynamicTypes, dcl);
}
} else {
// have a dynamic class loader throw an exception.
throw ValidationException.invalidClassLoaderForDynamicPersistence();
}
}
createRestInterfaces(loader);
}
Aggregations