|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.persister.entity.AbstractEntityPersister
public abstract class AbstractEntityPersister
Basic functionality for persisting an entity via JDBC through either generated or custom SQL
| Nested Class Summary | |
|---|---|
protected static interface |
AbstractEntityPersister.InclusionChecker
|
| Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable |
|---|
Queryable.Declarer |
| Field Summary | |
|---|---|
protected String[] |
customSQLDelete
|
protected String[] |
customSQLInsert
|
protected String[] |
customSQLUpdate
|
protected boolean[] |
deleteCallable
|
protected ExecuteUpdateResultCheckStyle[] |
deleteResultCheckStyles
|
static String |
ENTITY_CLASS
|
protected boolean[] |
insertCallable
|
protected ExecuteUpdateResultCheckStyle[] |
insertResultCheckStyles
|
protected BasicEntityPropertyMapping |
propertyMapping
|
protected String |
rowIdName
|
protected boolean[] |
updateCallable
|
protected ExecuteUpdateResultCheckStyle[] |
updateResultCheckStyles
|
| Fields inherited from interface org.hibernate.persister.entity.Loadable |
|---|
ROWID_ALIAS |
| Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
ENTITY_ID |
| Fields inherited from interface org.hibernate.persister.entity.Loadable |
|---|
ROWID_ALIAS |
| Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
ENTITY_ID |
| Fields inherited from interface org.hibernate.persister.entity.Loadable |
|---|
ROWID_ALIAS |
| Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
ENTITY_ID |
| Fields inherited from interface org.hibernate.persister.entity.Loadable |
|---|
ROWID_ALIAS |
| Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
ENTITY_ID |
| Fields inherited from interface org.hibernate.intercept.LazyPropertyInitializer |
|---|
UNFETCHED_PROPERTY |
| Constructor Summary | |
|---|---|
AbstractEntityPersister(PersistentClass persistentClass,
CacheConcurrencyStrategy cache,
SessionFactoryImplementor factory)
|
|
| Method Summary | |
|---|---|
protected void |
addDiscriminatorToInsert(Insert insert)
|
protected void |
addDiscriminatorToSelect(SelectFragment select,
String name,
String suffix)
|
void |
afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized |
void |
afterReassociate(Object entity,
SessionImplementor session)
Called just after the entity has been reassociated with the session |
boolean |
canExtractIdOutOfEntity()
Determine whether detahced instances of this entity carry their own identifier value. |
protected boolean |
check(int rows,
Serializable id,
int tableNumber,
Expectation expectation,
PreparedStatement statement)
|
protected String |
concretePropertySelectFragment(String alias,
AbstractEntityPersister.InclusionChecker inclusionChecker)
|
protected String |
concretePropertySelectFragment(String alias,
boolean[] includeProperty)
|
protected String |
concretePropertySelectFragment(String alias,
ValueInclusion[] inclusions)
|
protected String |
concretePropertySelectFragmentSansLeadingComma(String alias,
boolean[] include)
|
boolean |
consumesCollectionAlias()
Very, very, very ugly... |
boolean |
consumesEntityAlias()
Very, very, very ugly... |
int |
countSubclassProperties()
How many properties are there, for this class and all subclasses? |
protected UniqueEntityLoader |
createEntityLoader(LockMode lockMode)
|
protected UniqueEntityLoader |
createEntityLoader(LockMode lockMode,
Map enabledFilters)
|
protected String |
createFrom(int tableNumber,
String alias)
|
protected JoinFragment |
createJoin(int[] tableNumbers,
String drivingAlias)
|
protected JoinFragment |
createJoin(String name,
boolean innerJoin,
boolean includeSubclasses)
|
Object |
createProxy(Serializable id,
SessionImplementor session)
Create a new proxy instance |
protected void |
createQueryLoader()
|
protected SelectFragment |
createSelect(int[] subclassColumnNumbers,
int[] subclassFormulaNumbers)
|
protected void |
createUniqueKeyLoaders()
|
protected String |
createWhereByKey(int tableNumber,
String alias)
|
protected int |
dehydrate(Serializable id,
Object[] fields,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement st,
SessionImplementor session)
|
protected int |
dehydrate(Serializable id,
Object[] fields,
Object rowId,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement ps,
SessionImplementor session,
int index)
Marshall the fields of a persistent instance to a prepared statement |
protected void |
delete(Serializable id,
Object version,
int j,
Object object,
String sql,
SessionImplementor session,
Object[] loadedState)
Perform an SQL DELETE |
void |
delete(Serializable id,
Object version,
Object object,
SessionImplementor session)
Delete an object |
protected abstract String |
filterFragment(String alias)
|
String |
filterFragment(String alias,
Map enabledFilters)
Get the where clause filter, given a query alias and considering enabled session filters |
int[] |
findDirty(Object[] currentState,
Object[] previousState,
Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
int[] |
findModified(Object[] old,
Object[] current,
Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
Object |
forceVersionIncrement(Serializable id,
Object currentVersion,
SessionImplementor session)
|
String |
fromJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the from clause part of any joins (optional operation) |
protected String |
generateDeleteString(int j)
Generate the SQL that deletes a row by id (and version) |
String |
generateFilterConditionAlias(String rootAlias)
The alias used for any filter conditions (mapped where-fragments or enabled-filters). |
protected String |
generateIdentityInsertString(boolean[] includeProperty)
Used to generate an insery statement against the root table in the case of identifier generation strategies where the insert statement executions actually generates the identifier value. |
protected String |
generateInsertGeneratedValuesSelectString()
|
protected String |
generateInsertString(boolean[] includeProperty,
int j)
|
protected String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty)
|
protected String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty,
int j)
Generate the SQL that inserts a row |
protected String |
generateLazySelectString()
|
protected LockingStrategy |
generateLocker(LockMode lockMode)
|
protected String |
generateSelectVersionString()
Generate the SQL that selects the version number by id |
protected String |
generateSnapshotSelectString()
|
protected String |
generateTableAlias(String rootAlias,
int tableNumber)
|
protected String |
generateUpdateGeneratedValuesSelectString()
|
protected String |
generateUpdateString(boolean[] includeProperty,
int j,
boolean useRowId)
|
protected String |
generateUpdateString(boolean[] includeProperty,
int j,
Object[] oldFields,
boolean useRowId)
Generate the SQL that updates a row by id (and version) |
CacheConcurrencyStrategy |
getCache()
Get the cache (optional operation) |
CacheEntryStructure |
getCacheEntryStructure()
Get the cache structure |
CascadeStyle |
getCascadeStyle(int i)
Get the cascade style of this (subclass closure) property |
ClassMetadata |
getClassMetadata()
Get the user-visible metadata for the class (optional operation) |
Class |
getConcreteProxyClass(EntityMode entityMode)
Get the proxy interface that instances of this concrete class will be cast to (optional operation). |
Object |
getCurrentVersion(Serializable id,
SessionImplementor session)
Retrieve the version number |
Object[] |
getDatabaseSnapshot(Serializable id,
SessionImplementor session)
Get the current database state of the object, in a "hydrated" form, without resolving identifiers |
protected String |
getDiscriminatorAlias()
|
String |
getDiscriminatorAlias(String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
String |
getDiscriminatorColumnName()
|
protected String |
getDiscriminatorFormulaTemplate()
|
EntityMetamodel |
getEntityMetamodel()
Retrieve the underlying entity metamodel instance... |
String |
getEntityName()
The name of the entity |
EntityType |
getEntityType()
|
SessionFactoryImplementor |
getFactory()
Return the SessionFactory to which this persister "belongs". |
FetchMode |
getFetchMode(int i)
May this (subclass closure) property be fetched using an SQL outerjoin? |
Serializable |
getIdentifier(Object object,
EntityMode entityMode)
Get the identifier of an instance (throw an exception if no identifier property) |
protected String[] |
getIdentifierAliases()
|
String[] |
getIdentifierAliases(String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
String[] |
getIdentifierColumnNames()
Get the names of columns used to persist the identifier |
protected int |
getIdentifierColumnSpan()
|
IdentifierGenerator |
getIdentifierGenerator()
Determine which identifier generation strategy is used for this entity. |
String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null) |
Type |
getIdentifierType()
Get the identifier Hibernate type |
String |
getIdentitySelectString()
Get the database-specific SQL command to retrieve the last generated IDENTITY value. |
String[] |
getKeyColumnNames()
The columns to join on |
protected abstract String[] |
getKeyColumns(int j)
|
protected Set |
getLazyProperties()
|
Class |
getMappedClass(EntityMode entityMode)
The persistent class, or null |
String |
getMappedSuperclass()
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass |
String |
getName()
An identifying name; a class name or collection role name. |
int[] |
getNaturalIdentifierProperties()
Which properties hold the natural id? |
Object[] |
getNaturalIdentifierSnapshot(Serializable id,
SessionImplementor session)
Retrieve the current state of the natural-id properties from the database. |
boolean[] |
getNonLazyPropertyUpdateability()
|
protected boolean[] |
getPropertiesToInsert(Object[] fields)
Transform the array of property indexes to an array of booleans, true when the property is insertable and non-null |
protected boolean[] |
getPropertiesToUpdate(int[] dirtyProperties,
boolean hasDirtyCollection)
Transform the array of property indexes to an array of booleans, true when the property is dirty |
String[] |
getPropertyAliases(String suffix,
int i)
Get the result set aliases used for the property columns, given a suffix (properties of this class, only). |
CascadeStyle[] |
getPropertyCascadeStyles()
Get the cascade styles of the propertes (optional operation) |
boolean[] |
getPropertyCheckability()
Get the "checkability" of the properties of this class (is the property dirty checked, does the cache need to be updated) |
String[] |
getPropertyColumnNames(int i)
Get the result set column names mapped for this property (properties of this class, only). |
String[] |
getPropertyColumnNames(String propertyName)
Get the column names for the given property path |
protected int |
getPropertyColumnSpan(int i)
|
int |
getPropertyIndex(String propertyName)
Get the property number of the unique key property |
boolean[] |
getPropertyInsertability()
Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT) |
ValueInclusion[] |
getPropertyInsertGenerationInclusions()
Which of the properties of this class are database generated values on insert? |
boolean[] |
getPropertyLaziness()
Get the "laziness" of the properties of this class |
String[] |
getPropertyNames()
Get the names of the class' persistent properties |
boolean[] |
getPropertyNullability()
Get the nullability of the class' persistent properties |
protected int |
getPropertySpan()
|
protected String[] |
getPropertySubclassNames()
|
protected abstract int[] |
getPropertyTableNumbers()
|
protected abstract int[] |
getPropertyTableNumbersInSelect()
|
Type |
getPropertyType(String propertyName)
Get the type of a particular (named) property |
Type[] |
getPropertyTypes()
Get the Hibernate types of the class properties |
boolean[] |
getPropertyUpdateability()
Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE) |
protected boolean[] |
getPropertyUpdateability(Object entity,
EntityMode entityMode)
Which properties appear in the SQL update? (Initialized, updateable ones!) |
ValueInclusion[] |
getPropertyUpdateGenerationInclusions()
Which of the properties of this class are database generated values on update? |
Object |
getPropertyValue(Object object,
int i,
EntityMode entityMode)
Get the value of a particular property |
Object |
getPropertyValue(Object object,
String propertyName,
EntityMode entityMode)
Get the value of a particular (named) property |
Object[] |
getPropertyValues(Object object,
EntityMode entityMode)
Extract the property values from the given entity. |
Object[] |
getPropertyValuesToInsert(Object object,
Map mergeMap,
SessionImplementor session)
Return the values of the mapped properties of the object |
boolean[] |
getPropertyVersionability()
Get the "versionability" of the properties of this class (is the property optimistic-locked) |
Serializable[] |
getQuerySpaces()
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses. |
String |
getRootEntityName()
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique. |
String |
getRootTableAlias(String drivingAlias)
Get the SQL alias this persister would use for the root table given the passed driving alias. |
String[] |
getRootTableIdentifierColumnNames()
Get the names of columns on the root table used to persist the identifier. |
String[] |
getRootTableKeyColumnNames()
The names of the primary key columns in the root table. |
String |
getRootTableName()
Locks are always applied to the "root table". |
String |
getSelectByUniqueKeyString(String propertyName)
Get a SQL select string that performs a select based on a unique key determined by the given property name). |
protected String |
getSequentialSelect(String entityName)
|
protected String[] |
getSQLDeleteStrings()
|
protected String |
getSQLIdentityInsertString()
The query that inserts a row, letting the database generate an id |
protected String[] |
getSQLInsertStrings()
|
protected String |
getSQLLazySelectString()
|
protected String[] |
getSQLLazyUpdateByRowIdStrings()
|
protected String[] |
getSQLLazyUpdateStrings()
|
protected String |
getSQLSnapshotSelectString()
|
protected String[] |
getSQLUpdateByRowIdStrings()
|
protected String[] |
getSQLUpdateStrings()
|
protected String |
getSQLWhereString(String alias)
|
protected String[] |
getSubclassColumnAliasClosure()
|
protected String[] |
getSubclassColumnClosure()
|
protected boolean[] |
getSubclassColumnLazyiness()
|
protected abstract int[] |
getSubclassColumnTableNumberClosure()
|
EntityPersister |
getSubclassEntityPersister(Object instance,
SessionFactoryImplementor factory,
EntityMode entityMode)
Get the persister for an instance of this class or a subclass |
protected String[] |
getSubclassFormulaAliasClosure()
|
protected String[] |
getSubclassFormulaClosure()
|
protected boolean[] |
getSubclassFormulaLazyiness()
|
protected abstract int[] |
getSubclassFormulaTableNumberClosure()
|
protected String[] |
getSubclassFormulaTemplateClosure()
|
String[] |
getSubclassPropertyColumnAliases(String propertyName,
String suffix)
Return the column alias names used to persist/query the named property of the class or a subclass (optional operation). |
protected String[][] |
getSubclassPropertyColumnNameClosure()
|
String[] |
getSubclassPropertyColumnNames(int i)
Return the column names used to persist the numbered property of the class or a subclass. |
String[] |
getSubclassPropertyColumnNames(String propertyName)
Return the column names used to persist/query the named property of the class or a subclass (optional operation). |
Queryable.Declarer |
getSubclassPropertyDeclarer(String propertyPath)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses... |
protected String[][] |
getSubclassPropertyFormulaTemplateClosure()
|
String |
getSubclassPropertyName(int i)
Get the name of the numbered property of the class or a subclass. |
protected String[] |
getSubclassPropertyNameClosure()
|
protected String[] |
getSubclassPropertySubclassNameClosure()
|
protected abstract int |
getSubclassPropertyTableNumber(int i)
|
int |
getSubclassPropertyTableNumber(String propertyPath)
Warning: When there are duplicated property names in the subclasses of the class, this method may return the wrong table number for the duplicated subclass property (note that SingleTableEntityPersister defines an overloaded form which takes the entity name. |
Type |
getSubclassPropertyType(int i)
Get the type of the numbered property of the class or a subclass. |
protected Type[] |
getSubclassPropertyTypeClosure()
|
protected abstract String[] |
getSubclassTableKeyColumns(int j)
|
abstract String |
getSubclassTableName(int j)
Get the name of the table with the given index from the internal array. |
protected abstract int |
getSubclassTableSpan()
|
protected abstract String |
getTableName(int j)
|
protected abstract int |
getTableSpan()
|
protected boolean[] |
getTableUpdateNeeded(int[] dirtyProperties,
boolean hasDirtyCollection)
Decide which tables need to be updated. |
String |
getTemporaryIdTableDDL()
Get the appropriate DDL command for generating the temporary table to be used to (potentially) store id values when performing bulk update/deletes. |
String |
getTemporaryIdTableName()
Get the name of the temporary table to be used to (potentially) store id values when performing bulk update/deletes. |
protected EntityTuplizer |
getTuplizer(EntityMode entityMode)
|
protected EntityTuplizer |
getTuplizer(SessionImplementor session)
|
Type |
getType()
Get the type of the thing containing the properties |
Object |
getVersion(Object object,
EntityMode entityMode)
Get the version number (or timestamp) from the object's version property (or return null if not versioned) |
String |
getVersionColumnName()
For versioned entities, get the name of the column (again, expected on the root table) used to store the version values. |
Comparator |
getVersionComparator()
Get the comparator used to compare two different version values together. |
protected String |
getVersionedTableName()
|
int |
getVersionProperty()
Get the index of the version property |
protected String |
getVersionSelectString()
|
VersionType |
getVersionType()
If EntityPersister.isVersioned(), then what is the type of the property
holding the locking value. |
EntityMode |
guessEntityMode(Object object)
Try to discover the entity mode from the entity instance |
boolean |
hasCache()
Does this class have a cache. |
boolean |
hasCascades()
Determine whether this entity has any non-none cascading. |
boolean |
hasCollections()
Determine whether this entity contains references to persistent collections. |
protected boolean |
hasEmbeddedCompositeIdentifier()
|
protected boolean |
hasFormulaProperties()
|
boolean |
hasIdentifierProperty()
Does this class have an identifier property? |
boolean |
hasInsertGeneratedProperties()
Does this entity define any properties as being database generated on insert? |
boolean |
hasLazyProperties()
Determine whether this entity defines any lazy properties (ala bytecode instrumentation). |
boolean |
hasMutableProperties()
Determine whether any properties of this entity are considered mutable. |
boolean |
hasNaturalIdentifier()
Does this entity declare a natural id? |
boolean |
hasProxy()
Does this class support dynamic proxies? |
boolean |
hasRowId()
Does the result set contain rowids? |
boolean |
hasSequentialSelect()
|
boolean |
hasSubclasses()
Does this entity have mapped subclasses? |
boolean |
hasSubselectLoadableCollections()
Determine whether this entity contains references to persistent collections which are fetchable by subselect? |
boolean |
hasUninitializedLazyProperties(Object object,
EntityMode entityMode)
Does the given instance have any uninitialized lazy properties? |
boolean |
hasUpdateGeneratedProperties()
Does this entity define any properties as being database generated on update? |
protected boolean |
hasWhere()
|
Object[] |
hydrate(ResultSet rs,
Serializable id,
Object object,
Loadable rootLoadable,
String[][] suffixedPropertyColumns,
boolean allProperties,
SessionImplementor session)
Unmarshall the fields of a persistent instance from a result set, without resolving associations or collections. |
String |
identifierSelectFragment(String name,
String suffix)
Given a query alias and an identifying suffix, render the intentifier select fragment. |
boolean |
implementsLifecycle(EntityMode entityMode)
Does the class implement the Lifecycle interface? |
boolean |
implementsValidatable(EntityMode entityMode)
Does the class implement the Validatable interface? |
Object |
initializeLazyProperty(String fieldName,
Object entity,
SessionImplementor session)
Initialize the property, and return its new value |
protected void |
initLockers()
|
protected void |
initPropertyPaths(Mapping mapping)
|
protected void |
initSubclassPropertyAliasesMap(PersistentClass model)
Must be called by subclasses, at the end of their constructors |
protected Serializable |
insert(Object[] fields,
boolean[] notNull,
String sql,
Object object,
SessionImplementor session)
Perform an SQL INSERT, and then retrieve a generated identifier. |
Serializable |
insert(Object[] fields,
Object object,
SessionImplementor session)
Persist an instance, using a natively generated identifier (optional operation) |
protected void |
insert(Serializable id,
Object[] fields,
boolean[] notNull,
int j,
String sql,
Object object,
SessionImplementor session)
Perform an SQL INSERT. |
void |
insert(Serializable id,
Object[] fields,
Object object,
SessionImplementor session)
Persist an instance |
Object |
instantiate(Serializable id,
EntityMode entityMode)
Create a class instance initialized with the given identifier |
boolean |
isAbstract()
Is this an abstract class? |
boolean |
isBatchable()
|
boolean |
isBatchLoadable()
Is batch loading enabled? |
boolean |
isCacheInvalidationRequired()
We can't immediately add to the cache if we have formulas which must be evaluated, or if we have the possibility of two concurrent updates to the same item being merged on the database. |
protected abstract boolean |
isClassOrSuperclassTable(int j)
|
boolean |
isCollection()
Is this instance actually a CollectionPersister? |
boolean |
isDefinedOnSubclass(int i)
Is this property defined on a subclass of the mapped class. |
protected boolean |
isDeleteCallable(int j)
|
boolean |
isExplicitPolymorphism()
Is this class explicit polymorphism only? |
boolean |
isIdentifierAssignedByInsert()
Are identifiers of this entity assigned known before the insert execution? Or, are they generated (in the database) by the insert execution. |
boolean |
isInherited()
Does this entity extend a mapped superclass? |
protected boolean |
isInsertCallable(int j)
|
boolean |
isInstance(Object object,
EntityMode entityMode)
Is the given object an instance of this entity? |
boolean |
isInstrumented(EntityMode entityMode)
Has the class actually been bytecode instrumented? |
protected boolean |
isInverseSubclassTable(int j)
|
protected boolean |
isInverseTable(int j)
|
boolean |
isLazyPropertiesCacheable()
Should lazy properties of this entity be cached? |
boolean |
isMultiTable()
Is the inheritence hierarchy described by this persister contained across multiple tables? |
boolean |
isMutable()
Are instances of this class mutable? |
protected boolean |
isNullableSubclassTable(int j)
|
protected boolean |
isNullableTable(int j)
|
boolean |
isPolymorphic()
|
protected abstract boolean |
isPropertyOfTable(int property,
int j)
|
boolean |
isSelectBeforeUpdateRequired()
Is select snapshot before update enabled? |
boolean |
isSubclassEntityName(String entityName)
Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister. |
protected boolean |
isSubclassPropertyDeferred(String propertyName,
String entityName)
|
boolean |
isSubclassPropertyNullable(int i)
Is the numbered property of the class of subclass nullable? |
protected boolean |
isSubclassTableLazy(int j)
|
protected boolean |
isSubclassTableSequentialSelect(int j)
|
protected abstract boolean |
isTableCascadeDeleteEnabled(int j)
|
Boolean |
isTransient(Object entity,
SessionImplementor session)
Is this a new transient instance? |
protected boolean |
isUpdateCallable(int j)
|
boolean |
isVersioned()
Does this source represent versioned (i.e., and thus optimistically lockable) data? |
boolean |
isVersionPropertyGenerated()
Does this entity contain a version property that is defined to be database generated? |
boolean |
isVersionPropertyInsertable()
Is the version property included in insert statements? |
Object |
load(Serializable id,
Object optionalObject,
LockMode lockMode,
SessionImplementor session)
Load an instance using either the forUpdateLoader or the outer joining loader, depending upon the value of the lock parameter |
Object |
loadByUniqueKey(String propertyName,
Object uniqueKey,
SessionImplementor session)
Load an instance of the persistent class, by a unique key other than the primary key. |
void |
lock(Serializable id,
Object version,
Object object,
LockMode lockMode,
SessionImplementor session)
Do a version check (optional operation) |
protected void |
logStaticSQL()
|
String |
oneToManyFilterFragment(String alias)
|
protected int |
optimisticLockMode()
|
protected void |
postConstruct(Mapping mapping)
|
void |
postInstantiate()
Finish the initialization of this object. |
void |
processInsertGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to the PersistenceContext. |
void |
processUpdateGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to the PersistenceContext. |
String |
propertySelectFragment(String name,
String suffix,
boolean allProperties)
Given a query alias and an identifying suffix, render the property select fragment. |
protected String |
renderSelect(int[] tableNumbers,
int[] columnNumbers,
int[] formulaNumbers)
|
void |
resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion,
EntityMode entityMode)
Set the identifier and version of the given instance back to its "unsaved" value, returning the id |
String |
selectFragment(Joinable rhs,
String rhsAlias,
String lhsAlias,
String entitySuffix,
String collectionSuffix,
boolean includeCollectionColumns)
All columns to select, when loading. |
String |
selectFragment(String alias,
String suffix)
Generate a list of collection index, key and element columns |
void |
setIdentifier(Object object,
Serializable id,
EntityMode entityMode)
Set the identifier of an instance (or do nothing if no identifier property) |
void |
setPropertyValue(Object object,
int i,
Object value,
EntityMode entityMode)
Set the value of a particular property |
void |
setPropertyValue(Object object,
String propertyName,
Object value,
EntityMode entityMode)
Set the value of a particular (named) property |
void |
setPropertyValues(Object object,
Object[] values,
EntityMode entityMode)
Set the given values to the mapped properties of the given object |
String[] |
toColumns(String propertyName)
Given a property path, return the corresponding column name(s). |
String[] |
toColumns(String name,
int i)
Given the number of a property of a subclass, and a table alias, return the aliased column names. |
String[] |
toColumns(String alias,
String propertyName)
Given a query alias and a property path, return the qualified column name |
String |
toString()
|
Type |
toType(String propertyName)
Given a component path expression, get the type of the property |
void |
update(Serializable id,
Object[] fields,
int[] dirtyFields,
boolean hasDirtyCollection,
Object[] oldFields,
Object oldVersion,
Object object,
Object rowId,
SessionImplementor session)
Update an object |
protected boolean |
update(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
|
protected void |
updateOrInsert(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
Perform an SQL UPDATE or SQL INSERT |
protected boolean |
useDynamicInsert()
|
protected boolean |
useDynamicUpdate()
|
protected boolean |
useGetGeneratedKeys()
|
protected boolean |
useInsertSelectIdentity()
|
String |
whereJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the where clause part of any joins (optional operation) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.hibernate.persister.entity.OuterJoinLoadable |
|---|
fromTableFragment, getPropertyTableName, getSubclassPropertyTableName |
| Methods inherited from interface org.hibernate.persister.entity.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| Methods inherited from interface org.hibernate.persister.entity.Joinable |
|---|
getTableName |
| Methods inherited from interface org.hibernate.persister.entity.Queryable |
|---|
getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorSQLValue |
| Methods inherited from interface org.hibernate.persister.entity.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| Methods inherited from interface org.hibernate.persister.entity.Joinable |
|---|
getTableName |
| Methods inherited from interface org.hibernate.persister.entity.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| Methods inherited from interface org.hibernate.persister.entity.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| Field Detail |
|---|
public static final String ENTITY_CLASS
protected final String rowIdName
protected boolean[] insertCallable
protected boolean[] updateCallable
protected boolean[] deleteCallable
protected String[] customSQLInsert
protected String[] customSQLUpdate
protected String[] customSQLDelete
protected ExecuteUpdateResultCheckStyle[] insertResultCheckStyles
protected ExecuteUpdateResultCheckStyle[] updateResultCheckStyles
protected ExecuteUpdateResultCheckStyle[] deleteResultCheckStyles
protected final BasicEntityPropertyMapping propertyMapping
| Constructor Detail |
|---|
public AbstractEntityPersister(PersistentClass persistentClass,
CacheConcurrencyStrategy cache,
SessionFactoryImplementor factory)
throws HibernateException
HibernateException| Method Detail |
|---|
protected void addDiscriminatorToInsert(Insert insert)
protected void addDiscriminatorToSelect(SelectFragment select,
String name,
String suffix)
protected abstract int[] getSubclassColumnTableNumberClosure()
protected abstract int[] getSubclassFormulaTableNumberClosure()
public abstract String getSubclassTableName(int j)
Queryable
getSubclassTableName in interface Queryablej - The index into the internal array.
protected abstract String[] getSubclassTableKeyColumns(int j)
protected abstract boolean isClassOrSuperclassTable(int j)
protected abstract int getSubclassTableSpan()
protected abstract int getTableSpan()
protected abstract boolean isTableCascadeDeleteEnabled(int j)
protected abstract String getTableName(int j)
protected abstract String[] getKeyColumns(int j)
protected abstract boolean isPropertyOfTable(int property,
int j)
protected abstract int[] getPropertyTableNumbersInSelect()
protected abstract int[] getPropertyTableNumbers()
protected abstract int getSubclassPropertyTableNumber(int i)
protected abstract String filterFragment(String alias)
throws MappingException
MappingExceptionpublic String getDiscriminatorColumnName()
getDiscriminatorColumnName in interface Loadableprotected String getDiscriminatorAlias()
protected String getDiscriminatorFormulaTemplate()
protected boolean isInverseTable(int j)
protected boolean isNullableTable(int j)
protected boolean isNullableSubclassTable(int j)
protected boolean isInverseSubclassTable(int j)
public boolean isSubclassEntityName(String entityName)
EntityPersister
isSubclassEntityName in interface EntityPersisterentityName - The entity name to be checked.
public String[] getRootTableKeyColumnNames()
PostInsertIdentityPersister
getRootTableKeyColumnNames in interface PostInsertIdentityPersisterprotected String[] getSQLUpdateByRowIdStrings()
protected String[] getSQLLazyUpdateByRowIdStrings()
protected String getSQLSnapshotSelectString()
protected String getSQLLazySelectString()
protected String[] getSQLDeleteStrings()
protected String[] getSQLInsertStrings()
protected String[] getSQLUpdateStrings()
protected String[] getSQLLazyUpdateStrings()
protected String getSQLIdentityInsertString()
protected String getVersionSelectString()
protected boolean isInsertCallable(int j)
protected boolean isUpdateCallable(int j)
protected boolean isDeleteCallable(int j)
protected boolean isSubclassPropertyDeferred(String propertyName,
String entityName)
protected boolean isSubclassTableSequentialSelect(int j)
public boolean hasSequentialSelect()
protected boolean[] getTableUpdateNeeded(int[] dirtyProperties,
boolean hasDirtyCollection)
dirtyProperties - The indices of all the entity properties considered dirty.hasDirtyCollection - Whether any collections owned by the entity which were considered dirty.
public boolean hasRowId()
Loadable
hasRowId in interface Loadableprotected String generateLazySelectString()
public Object initializeLazyProperty(String fieldName,
Object entity,
SessionImplementor session)
throws HibernateException
LazyPropertyInitializer
initializeLazyProperty in interface LazyPropertyInitializerHibernateExceptionpublic boolean isBatchable()
public Serializable[] getQuerySpaces()
EntityPersisterEntityPersister.getPropertySpaces(), except that here we include subclass
entity spaces.
getQuerySpaces in interface EntityPersisterprotected Set getLazyProperties()
public boolean isBatchLoadable()
EntityPersister
isBatchLoadable in interface EntityPersisterpublic String[] getIdentifierColumnNames()
Loadable
getIdentifierColumnNames in interface LoadablegetIdentifierColumnNames in interface Queryableprotected int getIdentifierColumnSpan()
protected String[] getIdentifierAliases()
public String getVersionColumnName()
Lockable
getVersionColumnName in interface Lockableprotected String getVersionedTableName()
protected boolean[] getSubclassColumnLazyiness()
protected boolean[] getSubclassFormulaLazyiness()
public boolean isCacheInvalidationRequired()
isCacheInvalidationRequired in interface EntityPersisterpublic boolean isLazyPropertiesCacheable()
EntityPersister
isLazyPropertiesCacheable in interface EntityPersister
public String selectFragment(String alias,
String suffix)
OuterJoinLoadable
selectFragment in interface OuterJoinLoadableselectFragment in interface SQLLoadablepublic String[] getIdentifierAliases(String suffix)
Loadable
getIdentifierAliases in interface Loadable
public String[] getPropertyAliases(String suffix,
int i)
Loadable
getPropertyAliases in interface Loadablepublic String getDiscriminatorAlias(String suffix)
Loadable
getDiscriminatorAlias in interface Loadable
public String identifierSelectFragment(String name,
String suffix)
Queryable
identifierSelectFragment in interface Queryable
public String propertySelectFragment(String name,
String suffix,
boolean allProperties)
Queryable
propertySelectFragment in interface Queryable
public Object[] getDatabaseSnapshot(Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
getDatabaseSnapshot in interface EntityPersisterHibernateExceptionprotected String generateSelectVersionString()
protected String generateInsertGeneratedValuesSelectString()
protected String generateUpdateGeneratedValuesSelectString()
protected String concretePropertySelectFragment(String alias,
ValueInclusion[] inclusions)
protected String concretePropertySelectFragment(String alias,
boolean[] includeProperty)
protected String concretePropertySelectFragment(String alias,
AbstractEntityPersister.InclusionChecker inclusionChecker)
protected String generateSnapshotSelectString()
public Object forceVersionIncrement(Serializable id,
Object currentVersion,
SessionImplementor session)
forceVersionIncrement in interface EntityPersister
public Object getCurrentVersion(Serializable id,
SessionImplementor session)
throws HibernateException
getCurrentVersion in interface EntityPersisterHibernateExceptionprotected void initLockers()
protected LockingStrategy generateLocker(LockMode lockMode)
public void lock(Serializable id,
Object version,
Object object,
LockMode lockMode,
SessionImplementor session)
throws HibernateException
EntityPersister
lock in interface EntityPersisterHibernateExceptionpublic String getRootTableName()
Lockable
getRootTableName in interface Lockablepublic String getRootTableAlias(String drivingAlias)
Lockable
getRootTableAlias in interface LockabledrivingAlias - The driving alias; or the alias for the table
mapped by this persister in the hierarchy.
public String[] getRootTableIdentifierColumnNames()
Lockable
getRootTableIdentifierColumnNames in interface Lockable
public String[] toColumns(String alias,
String propertyName)
throws QueryException
PropertyMapping
toColumns in interface PropertyMappingQueryException
public String[] toColumns(String propertyName)
throws QueryException
PropertyMapping
toColumns in interface PropertyMappingQueryException
public Type toType(String propertyName)
throws QueryException
PropertyMapping
toType in interface PropertyMappingQueryExceptionpublic String[] getPropertyColumnNames(String propertyName)
OuterJoinLoadable
getPropertyColumnNames in interface OuterJoinLoadablepublic int getSubclassPropertyTableNumber(String propertyPath)
getSubclassPropertyTableNumber in interface QueryablepropertyPath - The name of the property.
public Queryable.Declarer getSubclassPropertyDeclarer(String propertyPath)
QueryableQueryable.getSubclassPropertyTableNumber(java.lang.String)
getSubclassPropertyDeclarer in interface QueryablepropertyPath - The property name.
protected String generateTableAlias(String rootAlias,
int tableNumber)
public String[] toColumns(String name,
int i)
OuterJoinLoadable
toColumns in interface OuterJoinLoadableprotected String[] getPropertySubclassNames()
public String[] getPropertyColumnNames(int i)
Loadable
getPropertyColumnNames in interface Loadableprotected int getPropertyColumnSpan(int i)
protected boolean hasFormulaProperties()
public FetchMode getFetchMode(int i)
OuterJoinLoadable
getFetchMode in interface OuterJoinLoadablepublic CascadeStyle getCascadeStyle(int i)
OuterJoinLoadable
getCascadeStyle in interface OuterJoinLoadablepublic Type getSubclassPropertyType(int i)
OuterJoinLoadable
getSubclassPropertyType in interface OuterJoinLoadablepublic String getSubclassPropertyName(int i)
OuterJoinLoadable
getSubclassPropertyName in interface OuterJoinLoadablepublic int countSubclassProperties()
OuterJoinLoadable
countSubclassProperties in interface OuterJoinLoadablepublic String[] getSubclassPropertyColumnNames(int i)
OuterJoinLoadable
getSubclassPropertyColumnNames in interface OuterJoinLoadablepublic boolean isDefinedOnSubclass(int i)
OuterJoinLoadable
isDefinedOnSubclass in interface OuterJoinLoadableprotected String[][] getSubclassPropertyFormulaTemplateClosure()
protected Type[] getSubclassPropertyTypeClosure()
protected String[][] getSubclassPropertyColumnNameClosure()
protected String[] getSubclassPropertyNameClosure()
protected String[] getSubclassPropertySubclassNameClosure()
protected String[] getSubclassColumnClosure()
protected String[] getSubclassColumnAliasClosure()
protected String[] getSubclassFormulaClosure()
protected String[] getSubclassFormulaTemplateClosure()
protected String[] getSubclassFormulaAliasClosure()
public String[] getSubclassPropertyColumnAliases(String propertyName,
String suffix)
SQLLoadable
getSubclassPropertyColumnAliases in interface SQLLoadablepublic String[] getSubclassPropertyColumnNames(String propertyName)
SQLLoadable
getSubclassPropertyColumnNames in interface SQLLoadable
protected void initSubclassPropertyAliasesMap(PersistentClass model)
throws MappingException
MappingException
public Object loadByUniqueKey(String propertyName,
Object uniqueKey,
SessionImplementor session)
throws HibernateException
UniqueKeyLoadable
loadByUniqueKey in interface UniqueKeyLoadableHibernateExceptionpublic int getPropertyIndex(String propertyName)
UniqueKeyLoadable
getPropertyIndex in interface UniqueKeyLoadable
protected void createUniqueKeyLoaders()
throws MappingException
MappingExceptionprotected String getSQLWhereString(String alias)
protected boolean hasWhere()
protected void initPropertyPaths(Mapping mapping)
throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode,
Map enabledFilters)
throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode)
throws MappingException
MappingException
protected boolean check(int rows,
Serializable id,
int tableNumber,
Expectation expectation,
PreparedStatement statement)
throws HibernateException
HibernateException
protected String generateUpdateString(boolean[] includeProperty,
int j,
boolean useRowId)
protected String generateUpdateString(boolean[] includeProperty,
int j,
Object[] oldFields,
boolean useRowId)
protected String generateInsertString(boolean[] includeProperty,
int j)
protected String generateInsertString(boolean identityInsert,
boolean[] includeProperty)
protected String generateInsertString(boolean identityInsert,
boolean[] includeProperty,
int j)
protected String generateIdentityInsertString(boolean[] includeProperty)
includeProperty - indices of the properties to include in the
insert statement.
protected String generateDeleteString(int j)
protected int dehydrate(Serializable id,
Object[] fields,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement st,
SessionImplementor session)
throws HibernateException,
SQLException
HibernateException
SQLException
protected int dehydrate(Serializable id,
Object[] fields,
Object rowId,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement ps,
SessionImplementor session,
int index)
throws SQLException,
HibernateException
SQLException
HibernateException
public Object[] hydrate(ResultSet rs,
Serializable id,
Object object,
Loadable rootLoadable,
String[][] suffixedPropertyColumns,
boolean allProperties,
SessionImplementor session)
throws SQLException,
HibernateException
hydrate in interface LoadableSQLException
HibernateExceptionprotected boolean useInsertSelectIdentity()
protected boolean useGetGeneratedKeys()
protected String getSequentialSelect(String entityName)
protected Serializable insert(Object[] fields,
boolean[] notNull,
String sql,
Object object,
SessionImplementor session)
throws HibernateException
HibernateExceptionpublic String getIdentitySelectString()
PostInsertIdentityPersister
getIdentitySelectString in interface PostInsertIdentityPersisterpublic String getSelectByUniqueKeyString(String propertyName)
PostInsertIdentityPersister
getSelectByUniqueKeyString in interface PostInsertIdentityPersisterpropertyName - The name of the property which maps to the
column(s) to use in the select statement restriction.
protected void insert(Serializable id,
Object[] fields,
boolean[] notNull,
int j,
String sql,
Object object,
SessionImplementor session)
throws HibernateException
HibernateException
protected void updateOrInsert(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
throws HibernateException
HibernateException
protected boolean update(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
throws HibernateException
HibernateException
protected void delete(Serializable id,
Object version,
int j,
Object object,
String sql,
SessionImplementor session,
Object[] loadedState)
throws HibernateException
HibernateException
public void update(Serializable id,
Object[] fields,
int[] dirtyFields,
boolean hasDirtyCollection,
Object[] oldFields,
Object oldVersion,
Object object,
Object rowId,
SessionImplementor session)
throws HibernateException
update in interface EntityPersisterHibernateException
public Serializable insert(Object[] fields,
Object object,
SessionImplementor session)
throws HibernateException
EntityPersister
insert in interface EntityPersisterHibernateException
public void insert(Serializable id,
Object[] fields,
Object object,
SessionImplementor session)
throws HibernateException
EntityPersister
insert in interface EntityPersisterHibernateException
public void delete(Serializable id,
Object version,
Object object,
SessionImplementor session)
throws HibernateException
delete in interface EntityPersisterHibernateExceptionprotected void logStaticSQL()
public String filterFragment(String alias,
Map enabledFilters)
throws MappingException
Joinable
filterFragment in interface JoinableMappingExceptionpublic String generateFilterConditionAlias(String rootAlias)
Queryable
generateFilterConditionAlias in interface QueryablerootAlias - The root alias
public String oneToManyFilterFragment(String alias)
throws MappingException
oneToManyFilterFragment in interface JoinableMappingException
public String fromJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Joinable
fromJoinFragment in interface Joinable
public String whereJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Joinable
whereJoinFragment in interface Joinableprotected boolean isSubclassTableLazy(int j)
protected JoinFragment createJoin(String name,
boolean innerJoin,
boolean includeSubclasses)
protected JoinFragment createJoin(int[] tableNumbers,
String drivingAlias)
protected SelectFragment createSelect(int[] subclassColumnNumbers,
int[] subclassFormulaNumbers)
protected String createFrom(int tableNumber,
String alias)
protected String createWhereByKey(int tableNumber,
String alias)
protected String renderSelect(int[] tableNumbers,
int[] columnNumbers,
int[] formulaNumbers)
protected void postConstruct(Mapping mapping)
throws MappingException
MappingException
public void postInstantiate()
throws MappingException
EntityPersisterSessionFactory lifecycle,
after all entity persisters have been instantiated.
postInstantiate in interface EntityPersisterMappingException - Indicates an issue in the metdata.protected void createQueryLoader()
public Object load(Serializable id,
Object optionalObject,
LockMode lockMode,
SessionImplementor session)
throws HibernateException
load in interface EntityPersisterHibernateExceptionpublic boolean isSubclassPropertyNullable(int i)
OuterJoinLoadable
isSubclassPropertyNullable in interface OuterJoinLoadable
protected final boolean[] getPropertiesToUpdate(int[] dirtyProperties,
boolean hasDirtyCollection)
protected boolean[] getPropertiesToInsert(Object[] fields)
public int[] findDirty(Object[] currentState,
Object[] previousState,
Object entity,
SessionImplementor session)
throws HibernateException
findDirty in interface EntityPersistercurrentState - The current state of the entity (the state to be checked).previousState - The previous state of the entity (the state to be checked against).entity - The entity for which we are checking state dirtiness.session - The session in which the check is ccurring.
HibernateException
public int[] findModified(Object[] old,
Object[] current,
Object entity,
SessionImplementor session)
throws HibernateException
findModified in interface EntityPersisterold - The old state of the entity.current - The current state of the entity.entity - The entity for which we are checking state modification.session - The session in which the check is ccurring.
HibernateException
protected boolean[] getPropertyUpdateability(Object entity,
EntityMode entityMode)
protected EntityTuplizer getTuplizer(SessionImplementor session)
protected EntityTuplizer getTuplizer(EntityMode entityMode)
public SessionFactoryImplementor getFactory()
EntityPersister
getFactory in interface EntityPersisterpublic EntityMetamodel getEntityMetamodel()
EntityPersister
getEntityMetamodel in interface EntityPersisterpublic boolean hasCache()
EntityPersister
hasCache in interface EntityPersisterpublic CacheConcurrencyStrategy getCache()
EntityPersister
getCache in interface EntityPersisterpublic CacheEntryStructure getCacheEntryStructure()
EntityPersister
getCacheEntryStructure in interface EntityPersisterpublic Comparator getVersionComparator()
OptimisticCacheSource
getVersionComparator in interface OptimisticCacheSourcepublic final String getEntityName()
ClassMetadata
getEntityName in interface ClassMetadatagetEntityName in interface EntityPersisterpublic EntityType getEntityType()
getEntityType in interface OuterJoinLoadablepublic boolean isPolymorphic()
public boolean isInherited()
ClassMetadata
isInherited in interface ClassMetadataisInherited in interface EntityPersisterpublic boolean hasCascades()
EntityPersister
hasCascades in interface EntityPersisterpublic boolean hasIdentifierProperty()
ClassMetadata
hasIdentifierProperty in interface ClassMetadatahasIdentifierProperty in interface EntityPersisterpublic VersionType getVersionType()
EntityPersisterEntityPersister.isVersioned(), then what is the type of the property
holding the locking value.
getVersionType in interface EntityPersisterpublic int getVersionProperty()
ClassMetadata
getVersionProperty in interface ClassMetadatagetVersionProperty in interface EntityPersisterpublic boolean isVersioned()
OptimisticCacheSource
isVersioned in interface OptimisticCacheSourceisVersioned in interface ClassMetadataisVersioned in interface EntityPersisterpublic boolean isIdentifierAssignedByInsert()
EntityPersister
isIdentifierAssignedByInsert in interface EntityPersisterpublic boolean hasLazyProperties()
EntityPersister
hasLazyProperties in interface EntityPersister
public void afterReassociate(Object entity,
SessionImplementor session)
EntityPersister
afterReassociate in interface EntityPersister
public Boolean isTransient(Object entity,
SessionImplementor session)
throws HibernateException
EntityPersister
isTransient in interface EntityPersisterHibernateExceptionpublic boolean hasCollections()
EntityPersister
hasCollections in interface EntityPersisterpublic boolean hasMutableProperties()
EntityPersister
hasMutableProperties in interface EntityPersisterpublic boolean isMutable()
ClassMetadata
isMutable in interface ClassMetadataisMutable in interface EntityPersisterpublic boolean isAbstract()
Queryable
isAbstract in interface LoadableisAbstract in interface Queryablepublic boolean hasSubclasses()
ClassMetadata
hasSubclasses in interface ClassMetadatahasSubclasses in interface Loadablepublic boolean hasProxy()
ClassMetadata
hasProxy in interface ClassMetadatahasProxy in interface EntityPersister
public IdentifierGenerator getIdentifierGenerator()
throws HibernateException
EntityPersister
getIdentifierGenerator in interface EntityPersisterHibernateExceptionpublic String getRootEntityName()
EntityPersister
getRootEntityName in interface EntityPersisterpublic ClassMetadata getClassMetadata()
EntityPersister
getClassMetadata in interface EntityPersisterpublic String getMappedSuperclass()
Queryable
getMappedSuperclass in interface Queryablepublic boolean isExplicitPolymorphism()
Queryable
isExplicitPolymorphism in interface Queryableprotected boolean useDynamicUpdate()
protected boolean useDynamicInsert()
protected boolean hasEmbeddedCompositeIdentifier()
public boolean canExtractIdOutOfEntity()
EntityPersister
canExtractIdOutOfEntity in interface EntityPersisterEntityPersister.hasIdentifierProperty() or
(2) the identifier is an embedded composite identifier; false otherwise.public String[] getKeyColumnNames()
Joinable
getKeyColumnNames in interface Joinablepublic String getName()
Joinable
getName in interface Joinablepublic boolean isCollection()
Joinable
isCollection in interface Joinablepublic boolean consumesEntityAlias()
Joinable
consumesEntityAlias in interface Joinablepublic boolean consumesCollectionAlias()
Joinable
consumesCollectionAlias in interface Joinable
public Type getPropertyType(String propertyName)
throws MappingException
ClassMetadata
getPropertyType in interface ClassMetadatagetPropertyType in interface EntityPersisterpropertyName - The name of the property for which to retrieve
the typpe.
MappingException - Typically indicates an unknown
property name.public Type getType()
PropertyMapping
getType in interface PropertyMappinggetType in interface SQLLoadablepublic boolean isSelectBeforeUpdateRequired()
EntityPersister
isSelectBeforeUpdateRequired in interface EntityPersisterprotected final int optimisticLockMode()
public Object createProxy(Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
createProxy in interface EntityPersisterHibernateExceptionpublic String toString()
toString in class Object
public final String selectFragment(Joinable rhs,
String rhsAlias,
String lhsAlias,
String entitySuffix,
String collectionSuffix,
boolean includeCollectionColumns)
Joinable
selectFragment in interface Joinablepublic boolean isInstrumented(EntityMode entityMode)
EntityPersister
isInstrumented in interface EntityPersisterpublic boolean hasInsertGeneratedProperties()
EntityPersister
hasInsertGeneratedProperties in interface EntityPersisterpublic boolean hasUpdateGeneratedProperties()
EntityPersister
hasUpdateGeneratedProperties in interface EntityPersisterpublic boolean isVersionPropertyGenerated()
EntityPersister
isVersionPropertyGenerated in interface EntityPersisterpublic boolean isVersionPropertyInsertable()
Queryable
isVersionPropertyInsertable in interface Queryable
public void afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
EntityPersister
afterInitialize in interface EntityPersisterpublic String[] getPropertyNames()
ClassMetadata
getPropertyNames in interface ClassMetadatagetPropertyNames in interface EntityPersisterpublic Type[] getPropertyTypes()
ClassMetadata
getPropertyTypes in interface ClassMetadatagetPropertyTypes in interface EntityPersisterpublic boolean[] getPropertyLaziness()
ClassMetadata
getPropertyLaziness in interface ClassMetadatagetPropertyLaziness in interface EntityPersisterpublic boolean[] getPropertyUpdateability()
EntityPersister
getPropertyUpdateability in interface EntityPersisterpublic boolean[] getPropertyCheckability()
EntityPersister
getPropertyCheckability in interface EntityPersisterpublic boolean[] getNonLazyPropertyUpdateability()
public boolean[] getPropertyInsertability()
EntityPersister
getPropertyInsertability in interface EntityPersisterpublic ValueInclusion[] getPropertyInsertGenerationInclusions()
EntityPersister
getPropertyInsertGenerationInclusions in interface EntityPersisterpublic ValueInclusion[] getPropertyUpdateGenerationInclusions()
EntityPersister
getPropertyUpdateGenerationInclusions in interface EntityPersisterpublic boolean[] getPropertyNullability()
ClassMetadata
getPropertyNullability in interface ClassMetadatagetPropertyNullability in interface EntityPersisterpublic boolean[] getPropertyVersionability()
EntityPersister
getPropertyVersionability in interface EntityPersisterpublic CascadeStyle[] getPropertyCascadeStyles()
EntityPersister
getPropertyCascadeStyles in interface EntityPersisterpublic final Class getMappedClass(EntityMode entityMode)
ClassMetadata
getMappedClass in interface ClassMetadatagetMappedClass in interface EntityPersisterpublic boolean implementsLifecycle(EntityMode entityMode)
ClassMetadata
implementsLifecycle in interface ClassMetadataimplementsLifecycle in interface EntityPersisterpublic boolean implementsValidatable(EntityMode entityMode)
ClassMetadata
implementsValidatable in interface ClassMetadataimplementsValidatable in interface EntityPersisterpublic Class getConcreteProxyClass(EntityMode entityMode)
EntityPersister
getConcreteProxyClass in interface EntityPersister
public void setPropertyValues(Object object,
Object[] values,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setPropertyValues in interface ClassMetadatasetPropertyValues in interface EntityPersisterHibernateException
public void setPropertyValue(Object object,
int i,
Object value,
EntityMode entityMode)
throws HibernateException
EntityPersister
setPropertyValue in interface EntityPersisterHibernateException
public Object[] getPropertyValues(Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getPropertyValues in interface ClassMetadatagetPropertyValues in interface EntityPersisterobject - The entity from which to extract the property values.entityMode - The entity-mode of the given entity
HibernateException
public Object getPropertyValue(Object object,
int i,
EntityMode entityMode)
throws HibernateException
EntityPersister
getPropertyValue in interface EntityPersisterHibernateException
public Object getPropertyValue(Object object,
String propertyName,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getPropertyValue in interface ClassMetadatagetPropertyValue in interface EntityPersisterHibernateException
public Serializable getIdentifier(Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getIdentifier in interface ClassMetadatagetIdentifier in interface EntityPersisterHibernateException
public void setIdentifier(Object object,
Serializable id,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setIdentifier in interface ClassMetadatasetIdentifier in interface EntityPersisterHibernateException
public Object getVersion(Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getVersion in interface ClassMetadatagetVersion in interface EntityPersisterHibernateException
public Object instantiate(Serializable id,
EntityMode entityMode)
throws HibernateException
ClassMetadata
instantiate in interface ClassMetadatainstantiate in interface EntityPersisterHibernateException
public boolean isInstance(Object object,
EntityMode entityMode)
EntityPersister
isInstance in interface EntityPersister
public boolean hasUninitializedLazyProperties(Object object,
EntityMode entityMode)
EntityPersister
hasUninitializedLazyProperties in interface EntityPersister
public void resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion,
EntityMode entityMode)
EntityPersister
resetIdentifier in interface EntityPersistercurrentId - TODOcurrentVersion - TODO
public EntityPersister getSubclassEntityPersister(Object instance,
SessionFactoryImplementor factory,
EntityMode entityMode)
EntityPersister
getSubclassEntityPersister in interface EntityPersisterpublic EntityMode guessEntityMode(Object object)
EntityPersister
guessEntityMode in interface EntityPersisterpublic boolean isMultiTable()
Queryable
isMultiTable in interface Queryablepublic String getTemporaryIdTableName()
Queryable
getTemporaryIdTableName in interface Queryablepublic String getTemporaryIdTableDDL()
Queryable
getTemporaryIdTableDDL in interface Queryableprotected int getPropertySpan()
public Object[] getPropertyValuesToInsert(Object object,
Map mergeMap,
SessionImplementor session)
throws HibernateException
ClassMetadata
getPropertyValuesToInsert in interface ClassMetadatagetPropertyValuesToInsert in interface EntityPersisterHibernateException
public void processInsertGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
EntityPersisterPersistenceContext.
Note, that because we update the PersistenceContext here, callers
need to take care that they have already written the initial snapshot
to the PersistenceContext before calling this method.
processInsertGeneratedProperties in interface EntityPersisterid - The entity's id value.entity - The entity for which to get the state.session - The session
public void processUpdateGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
EntityPersisterPersistenceContext.
Note, that because we update the PersistenceContext here, callers
need to take care that they have already written the initial snapshot
to the PersistenceContext before calling this method.
processUpdateGeneratedProperties in interface EntityPersisterid - The entity's id value.entity - The entity for which to get the state.session - The sessionpublic String getIdentifierPropertyName()
ClassMetadata
getIdentifierPropertyName in interface ClassMetadatagetIdentifierPropertyName in interface EntityPersisterpublic Type getIdentifierType()
ClassMetadata
getIdentifierType in interface ClassMetadatagetIdentifierType in interface EntityPersisterpublic boolean hasSubselectLoadableCollections()
EntityPersister
hasSubselectLoadableCollections in interface EntityPersisterpublic int[] getNaturalIdentifierProperties()
ClassMetadata
getNaturalIdentifierProperties in interface ClassMetadatagetNaturalIdentifierProperties in interface EntityPersister
public Object[] getNaturalIdentifierSnapshot(Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
getNaturalIdentifierSnapshot in interface EntityPersisterid - The identifier of the entity for which to retrieve the naturak-id values.session - The session from which the request originated.
HibernateException
protected String concretePropertySelectFragmentSansLeadingComma(String alias,
boolean[] include)
public boolean hasNaturalIdentifier()
ClassMetadata
hasNaturalIdentifier in interface ClassMetadatahasNaturalIdentifier in interface EntityPersister
public void setPropertyValue(Object object,
String propertyName,
Object value,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setPropertyValue in interface ClassMetadataHibernateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||