public class DynamicHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DynamicHelper.SessionCustomizer
A SessionCustomizer which configures all descriptors as dynamic entity
types.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,ClassDescriptor> |
fqClassnameToDescriptor |
protected DatabaseSession |
session |
Constructor and Description |
---|
DynamicHelper(DatabaseSession session) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected DatabaseSession session
protected java.util.Map<java.lang.String,ClassDescriptor> fqClassnameToDescriptor
public DynamicHelper(DatabaseSession session)
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)
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)
createMissingTables
- generateFKConstraints
- types
-