Top Description Inners Fields Constructors Methods
org.eclipse.persistence.dynamic

public Class DynamicHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, java.util.ArrayList, .Collection, .HashMap, .Iterator, .Map, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.expressions.ExpressionBuilder, org.eclipse.persistence.internal.dynamic.DynamicEntityImpl, .DynamicPropertiesManager, .DynamicTypeImpl, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.queries.ReadAllQuery, .ReadObjectQuery, .ReportQuery, org.eclipse.persistence.sessions.DatabaseSession, .Session, org.eclipse.persistence.tools.schemaframework.DynamicSchemaManager

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.
Author
dclarke, mnorman
Since
EclipseLink 1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
DynamicHelper.SessionCustomizer

A SessionCustomizer which configures all descriptors as dynamic entity types.

Field Summary

Modifier and TypeField and Description
protected Map<String, ClassDescriptor>
protected DatabaseSession

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public 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.

public DynamicClassLoader
public DatabaseSession
public DynamicType
getType(String typeName)

Lookup the dynamic type for an alias.

public static DynamicType
public static DynamicType
getType(DynamicEntity entity)

Provide access to the entity's type.

public DynamicEntity
public ReadAllQuery
newReadAllQuery(String typeName)

Helper method to simplify creating a native ReadAllQuery using the entity type name (descriptor alias)

public ReadObjectQuery
newReadObjectQuery(String typeName)

Helper method to simplify creating a native ReadObjectQuery using the entity type name (descriptor alias)

public ReportQuery
newReportQuery(String typeName, ExpressionBuilder builder)

Helper method to simplify creating a native ReportQuery using the entity type name (descriptor alias)

public void
removeType(String typeName)

Remove a dynamic type from the system.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fqClassnameToDescriptorback to summary
protected Map<String, ClassDescriptor> fqClassnameToDescriptor
sessionback to summary
protected DatabaseSession session

Constructor Detail

DynamicHelperback to summary
public DynamicHelper(DatabaseSession session)

Method Detail

addTypesback to summary
public 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.

getDynamicClassLoaderback to summary
public DynamicClassLoader getDynamicClassLoader()
getSessionback to summary
public DatabaseSession getSession()
getTypeback to summary
public DynamicType getType(String typeName)

Lookup the dynamic type for an alias. This is required to get the type for factory creation but can also be used to provide the application with access to the meta model (type and properties) allowing for dynamic use as well as optimized data value retrieval from an entity.

getTypeback to summary
public static DynamicType getType(ClassDescriptor descriptor)
getTypeback to summary
public static DynamicType getType(DynamicEntity entity) throws ClassCastException

Provide access to the entity's type.

Exceptions
ClassCastException:
if entity is not an instance of DynamicEntityImpl
newDynamicEntityback to summary
public DynamicEntity newDynamicEntity(String typeName)
newReadAllQueryback to summary
public ReadAllQuery newReadAllQuery(String typeName)

Helper method to simplify creating a native ReadAllQuery using the entity type name (descriptor alias)

newReadObjectQueryback to summary
public ReadObjectQuery newReadObjectQuery(String typeName)

Helper method to simplify creating a native ReadObjectQuery using the entity type name (descriptor alias)

newReportQueryback to summary
public ReportQuery newReportQuery(String typeName, ExpressionBuilder builder)

Helper method to simplify creating a native ReportQuery using the entity type name (descriptor alias)

removeTypeback to summary
public void removeType(String typeName)

Remove a dynamic type from the system. This implementation assumes that the dynamic type has no relationships to it and that it is not involved in an inheritance relationship. If there are concurrent processes using this type when it is removed some exceptions may occur.

org.eclipse.persistence.dynamic back to summary

public Class DynamicHelper.SessionCustomizer

extends Object
implements SessionCustomizer
Class Inheritance
  • java.lang.Object
  • org.eclipse.persistence.dynamic.DynamicHelper.SessionCustomizer
All Implemented Interfaces
org.eclipse.persistence.config.SessionCustomizer

A SessionCustomizer which configures all descriptors as dynamic entity types.

Constructor Summary

AccessConstructor and Description
public
SessionCustomizer()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SessionCustomizerback to summary
public SessionCustomizer()

Default constructor.

Method Detail

customizeback to summary
public void customize(Session session) throws Exception

Implements org.eclipse.persistence.config.SessionCustomizer.customize.

Annotations
@Override