X - The represented entity typepublic class EntityTypeImpl<X> extends IdentifiableTypeImpl<X> implements EntityType<X>
EntityType.Type.PersistenceTypeBindable.BindableType| Constructor and Description |
|---|
EntityTypeImpl(MetamodelImpl metamodel,
IdentifiableTypeImpl<? super X> parent,
Class<X> javaType,
EntityMetadata metadata) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAttribute(AttributeImpl<? super X,?> attribute)
Adds the attribute into attributes.
|
boolean |
extendz(EntityTypeImpl<?> parent)
Returns if this entity extends the parent entity.
|
void |
fireCallbacks(Object instance,
EntityListenerMetadata.EntityListenerType type)
Fires the callbacks.
|
EntityTable[] |
getAllTables()
Returns all the tables in the inheritance chain.
|
AssociationMetadata |
getAssociationOverride(String path)
Returns if attribute with the
path is overridden by the entity. |
AssociationMapping<?,?,?>[] |
getAssociations()
Returns the associations of the type.
|
AssociationMapping<?,?,?>[] |
getAssociationsDetachable()
Returns the associated attributes that are detachable by the type.
|
AssociationMapping<?,?,?>[] |
getAssociationsJoined()
Returns the associated attributes that are joined.
|
AssociationMapping<?,?,?>[] |
getAssociationsNotPersistable()
Returns the plural associations that are not persistable.
|
AssociationMapping<?,?,?>[] |
getAssociationsPersistable()
Returns the associated attributes that are persistable by the type.
|
PluralAssociationMapping<?,?,?>[] |
getAssociationsPlural()
Returns the plural associations.
|
AssociationMapping<?,?,?>[] |
getAssociationsRemovable()
Returns the associated mappings that are removable by the type.
|
SingularAssociationMapping<?,?>[] |
getAssociationsSingular()
Returns the singular associated mappings.
|
SingularAssociationMapping<?,?>[] |
getAssociationsSingularOwnerLazy()
Returns the array of singular owner lazy association of the type.
|
ColumnMetadata |
getAttributeOverride(String path)
Returns if attribute with the
path is overridden by the entity. |
BasicMapping<?,?>[] |
getBasicMappings()
Returns the basic mappings of the type.
|
Class<X> |
getBindableJavaType() |
Bindable.BindableType |
getBindableType() |
EntityTypeImpl<? extends X> |
getChildType(Object discriminatorValue)
Returns the child based on the
discriminatorValue value. |
AssociationMapping<?,?,?>[] |
getDependenciesFor(EntityTypeImpl<?> associate)
Returns the dependencies for the associate type
|
int |
getDependencyCount()
Returns the dependencyCount.
|
DiscriminatorColumn |
getDiscriminatorColumn()
Returns the discriminator column of the entity.
|
Set<String> |
getDiscriminators()
Returns the set of discriminator values in the range of this entity's hierarchy.
|
String |
getDiscriminatorValue()
Returns the discriminatorValue of the EntityTypeImpl.
|
SingularMapping<? super X,?> |
getIdMapping()
Returns the single id mapping.
|
Pair<BasicMapping<? super X,?>,BasicAttribute<?,?>>[] |
getIdMappings()
Returns an array of id attributes.
|
InheritanceType |
getInheritanceType()
Returns the inheritance type of the entity.
|
Object |
getInstanceId(X instance)
Returns the id of the instance.
|
ManagedInstance<X> |
getManagedInstance(SessionImpl session,
X instance)
Returns the managed instance for the instance.
|
ManagedInstance<X> |
getManagedInstanceById(SessionImpl session,
ManagedId<X> id,
boolean lazy)
Creates a new managed instance with the id.
|
Object |
getMappedId(String name,
Object instance)
Returns the mapped id.
|
JoinedMapping<?,?,?>[] |
getMappingsJoined()
Retuns the element collection mappings.
|
PluralMapping<?,?,?>[] |
getMappingsPlural()
Retuns the element collection mappings.
|
PluralMapping<?,?,?>[] |
getMappingsPluralSorted()
Returns the sorted plural associations.
|
Mapping<?,?,?>[] |
getMappingsSingular()
Returns the singular mappings.
|
String |
getName()
Returns the name of the type.
|
EntityTypeImpl<? super X> |
getParent()
Returns the parent of the entity.
|
Type.PersistenceType |
getPersistenceType() |
EntityTable |
getPrimaryTable()
Returns the primary table of the type
|
EntityMapping<X> |
getRootMapping()
Returns the entityMapping of the EntityTypeImpl.
|
EntityTypeImpl<? super X> |
getRootType()
Returns the root type of the hierarchy.
|
AbstractTable |
getTable(String tableName)
Returns the table with the name.
|
EntityTable[] |
getTables()
Returns the tables of the type, starting from the top of the hierarchy.
|
boolean |
isCachable()
Returns if the entity is cachable.
|
boolean |
isIdMethod(Method method)
Returns if the method is an id method.
|
boolean |
isRoot()
Returns if the entity is the root of the hierarchy.
|
void |
performInsert(ConnectionImpl connection,
ManagedInstance<X> instance)
Performs inserts to each table for the managed instance.
|
void |
performRefresh(ConnectionImpl connection,
ManagedInstance<X> instance,
LockModeType lockMode)
Performs refresh for the instance
|
void |
performRemove(ConnectionImpl connection,
ManagedInstance<X> instance) |
X |
performSelect(EntityManagerImpl entityManager,
Object id,
LockModeType lockMode)
Performs select to find the instance.
|
Object |
performSelectVersion(ConnectionImpl connection,
ManagedInstance<? extends X> instance)
Selects the version for the instance.
|
void |
performUpdate(ConnectionImpl connection,
ManagedInstance<X> instance)
Performs the update for the instance.
|
void |
performVersionUpdate(ConnectionImpl connection,
ManagedInstance<? extends X> instance)
Performs the version update for the instance.
|
void |
prepareDependenciesFor(EntityTypeImpl<?> associate)
Prepares the dependencies for the associate.
|
void |
prepareEagerJoins(FetchParent<?,?> r,
int depth,
AssociationMapping<?,?,?> parent) |
void |
runValidators(EntityManagerFactoryImpl entityManagerFactory,
ManagedInstance<?> instance)
Runs the validators for the instance
|
String |
toString() |
addAttributes, fireCallbacks, getAvailability, getCallbackManager, getDeclaredId, getDeclaredVersion, getId, getIdClassAttributes, getIdType, getSupertype, getVersion, getVersionAttribute, getVersionType, hasSingleIdAttribute, hasVersionAttribute, updateAvailabilitygetAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getLocator, getMap, getMap, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributesgetJavaType, getMetamodelclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDeclaredId, getDeclaredVersion, getId, getIdClassAttributes, getIdType, getSupertype, getVersion, hasSingleIdAttribute, hasVersionAttributegetAttribute, getAttributes, getCollection, getCollection, getDeclaredAttribute, getDeclaredAttributes, getDeclaredCollection, getDeclaredCollection, getDeclaredList, getDeclaredList, getDeclaredMap, getDeclaredMap, getDeclaredPluralAttributes, getDeclaredSet, getDeclaredSet, getDeclaredSingularAttribute, getDeclaredSingularAttribute, getDeclaredSingularAttributes, getList, getList, getMap, getMap, getPluralAttributes, getSet, getSet, getSingularAttribute, getSingularAttribute, getSingularAttributesgetJavaTypepublic EntityTypeImpl(MetamodelImpl metamodel, IdentifiableTypeImpl<? super X> parent, Class<X> javaType, EntityMetadata metadata)
metamodel - the metamodelparent - the parent typejavaType - the java type of the managed typemetadata - the metadataprotected void addAttribute(AttributeImpl<? super X,?> attribute)
addAttribute in class IdentifiableTypeImpl<X>attribute - the declared attributepublic boolean extendz(EntityTypeImpl<?> parent)
parent - the parent to testpublic void fireCallbacks(Object instance, EntityListenerMetadata.EntityListenerType type)
instance - the instancetype - the typepublic EntityTable[] getAllTables()
public AssociationMetadata getAssociationOverride(String path)
path is overridden by the entity.path - the path of the attributenullpublic AssociationMapping<?,?,?>[] getAssociations()
public AssociationMapping<?,?,?>[] getAssociationsDetachable()
public AssociationMapping<?,?,?>[] getAssociationsJoined()
public AssociationMapping<?,?,?>[] getAssociationsNotPersistable()
public AssociationMapping<?,?,?>[] getAssociationsPersistable()
public PluralAssociationMapping<?,?,?>[] getAssociationsPlural()
public AssociationMapping<?,?,?>[] getAssociationsRemovable()
public SingularAssociationMapping<?,?>[] getAssociationsSingular()
public SingularAssociationMapping<?,?>[] getAssociationsSingularOwnerLazy()
public ColumnMetadata getAttributeOverride(String path)
path is overridden by the entity.path - the path of the attributenullpublic BasicMapping<?,?>[] getBasicMappings()
public Class<X> getBindableJavaType()
getBindableJavaType in interface Bindable<X>public Bindable.BindableType getBindableType()
getBindableType in interface Bindable<X>public EntityTypeImpl<? extends X> getChildType(Object discriminatorValue)
discriminatorValue value.discriminatorValue - the discriminator value of the childpublic AssociationMapping<?,?,?>[] getDependenciesFor(EntityTypeImpl<?> associate)
associate - the associate typepublic int getDependencyCount()
public DiscriminatorColumn getDiscriminatorColumn()
public Set<String> getDiscriminators()
public String getDiscriminatorValue()
public SingularMapping<? super X,?> getIdMapping()
public Pair<BasicMapping<? super X,?>,BasicAttribute<?,?>>[] getIdMappings()
public InheritanceType getInheritanceType()
nullpublic Object getInstanceId(X instance)
instance - the instancepublic ManagedInstance<X> getManagedInstance(SessionImpl session, X instance)
instance - the instance to create managed instance forsession - the sessionNullPointerException - thrown if the instance is nullpublic ManagedInstance<X> getManagedInstanceById(SessionImpl session, ManagedId<X> id, boolean lazy)
session - the sessionid - the primary keylazy - if the instance is lazypublic Object getMappedId(String name, Object instance)
name - thename of the id fieldinstance - the instancepublic JoinedMapping<?,?,?>[] getMappingsJoined()
public PluralMapping<?,?,?>[] getMappingsPlural()
public PluralMapping<?,?,?>[] getMappingsPluralSorted()
public Mapping<?,?,?>[] getMappingsSingular()
public String getName()
getName in interface EntityType<X>getName in class ManagedTypeImpl<X>public EntityTypeImpl<? super X> getParent()
nullpublic Type.PersistenceType getPersistenceType()
getPersistenceType in interface Type<X>public EntityTable getPrimaryTable()
public EntityMapping<X> getRootMapping()
public EntityTypeImpl<? super X> getRootType()
public AbstractTable getTable(String tableName)
If the tableName is blank then the primary table is returned
tableName - the name of the table, may be blankpublic EntityTable[] getTables()
public boolean isCachable()
public boolean isIdMethod(Method method)
method - the methodpublic boolean isRoot()
public void performInsert(ConnectionImpl connection, ManagedInstance<X> instance) throws SQLException
connection - the connection to useinstance - the managed instance to perform insert forSQLException - thrown in case of an SQL Errorpublic void performRefresh(ConnectionImpl connection, ManagedInstance<X> instance, LockModeType lockMode)
connection - the connectioninstance - the managed instancelockMode - the lock modepublic void performRemove(ConnectionImpl connection, ManagedInstance<X> instance) throws SQLException
connection - the connection to useinstance - the managed instance to perform remove forSQLException - thrown in case of an SQL Errorpublic X performSelect(EntityManagerImpl entityManager, Object id, LockModeType lockMode)
entityManager - the entity manager to useid - the id of the instance to selectlockMode - the lock modepublic Object performSelectVersion(ConnectionImpl connection, ManagedInstance<? extends X> instance) throws SQLException
connection - the connection to useinstance - the managed instance to perform update forSQLException - thrown in case of an SQL Errorpublic void performUpdate(ConnectionImpl connection, ManagedInstance<X> instance) throws SQLException
connection - the connection to useinstance - the managed instance to perform update forSQLException - thrown in case of an SQL Errorpublic void performVersionUpdate(ConnectionImpl connection, ManagedInstance<? extends X> instance) throws SQLException
connection - the connection to useinstance - the managed instance to perform update forSQLException - thrown in case of an SQL Errorpublic void prepareDependenciesFor(EntityTypeImpl<?> associate)
associate - the associatepublic void prepareEagerJoins(FetchParent<?,?> r, int depth, AssociationMapping<?,?,?> parent)
r - the fetch parentdepth - the depthparent - the parentpublic void runValidators(EntityManagerFactoryImpl entityManagerFactory, ManagedInstance<?> instance)
entityManagerFactory - the entity manager factoryinstance - the instanceCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.