|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.dynamic.DynamicHelper
public class DynamicHelper
A DynamicHelper provides some utility methods to simplify application development with dynamic types. Since the application does not have static references to the dynamic types it must use entity names. This helper provides simplified access to methods that would typically require the static classes.
Nested Class Summary | |
---|---|
static class |
DynamicHelper.SessionCustomizer
A SessionCustomizer which configures all descriptors as dynamic entity types. |
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,ClassDescriptor> |
fqClassnameToDescriptor
|
protected DatabaseSession |
session
|
Constructor Summary | |
---|---|
DynamicHelper(DatabaseSession session)
|
Method Summary | |
---|---|
void |
addTypes(boolean createMissingTables,
boolean generateFKConstraints,
DynamicType... types)
Add one or more EntityType instances to a session and optionally generate needed tables with or without FK constraints. |
DynamicClassLoader |
getDynamicClassLoader()
|
DatabaseSession |
getSession()
|
static DynamicType |
getType(ClassDescriptor descriptor)
|
static DynamicType |
getType(DynamicEntity entity)
Provide access to the entity's type. |
DynamicType |
getType(java.lang.String typeName)
Lookup the dynamic type for an alias. |
DynamicEntity |
newDynamicEntity(java.lang.String typeName)
|
ReadAllQuery |
newReadAllQuery(java.lang.String typeName)
Helper method to simplify creating a native ReadAllQuery using the entity type name (descriptor alias) |
ReadObjectQuery |
newReadObjectQuery(java.lang.String typeName)
Helper method to simplify creating a native ReadObjectQuery using the entity type name (descriptor alias) |
ReportQuery |
newReportQuery(java.lang.String typeName,
ExpressionBuilder builder)
Helper method to simplify creating a native ReportQuery using the entity type name (descriptor alias) |
void |
removeType(java.lang.String typeName)
Remove a dynamic type from the system. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DatabaseSession session
protected java.util.Map<java.lang.String,ClassDescriptor> fqClassnameToDescriptor
Constructor Detail |
---|
public DynamicHelper(DatabaseSession session)
Method Detail |
---|
public DatabaseSession getSession()
public DynamicType getType(java.lang.String typeName)
public static DynamicType getType(ClassDescriptor descriptor)
public static DynamicType getType(DynamicEntity entity) throws java.lang.ClassCastException
entity
-
java.lang.ClassCastException
- if entity is not an instance of DynamicEntityImpl
public void removeType(java.lang.String typeName)
session
- typeName
- public DynamicEntity newDynamicEntity(java.lang.String typeName)
public ReadAllQuery newReadAllQuery(java.lang.String typeName)
public ReadObjectQuery newReadObjectQuery(java.lang.String typeName)
public ReportQuery newReportQuery(java.lang.String typeName, ExpressionBuilder builder)
public DynamicClassLoader getDynamicClassLoader()
public void addTypes(boolean createMissingTables, boolean generateFKConstraints, DynamicType... types)
session
- createMissingTables
- generateFKConstraints
- types
-
|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |