use of org.hibernate.persister.walking.spi.EntityIdentifierDefinition in project hibernate-orm by hibernate.
the class AbstractEntityReference method buildIdentifierDescription.
/**
* Builds just the first level of identifier description. This will be either a simple id descriptor (String,
* Long, etc) or some form of composite id (either encapsulated or not).
*
* @return the descriptor for the identifier
*/
private EntityIdentifierDescription buildIdentifierDescription() {
final EntityIdentifierDefinition identifierDefinition = getEntityPersister().getEntityKeyDefinition();
if (identifierDefinition.isEncapsulated()) {
final EncapsulatedEntityIdentifierDefinition encapsulatedIdentifierDefinition = (EncapsulatedEntityIdentifierDefinition) identifierDefinition;
final Type idAttributeType = encapsulatedIdentifierDefinition.getAttributeDefinition().getType();
if (!CompositeType.class.isInstance(idAttributeType)) {
return new SimpleEntityIdentifierDescriptionImpl();
}
}
// if we get here, we know we have a composite identifier...
final ExpandingCompositeQuerySpace querySpace = expandingEntityQuerySpace().makeCompositeIdentifierQuerySpace();
return identifierDefinition.isEncapsulated() ? buildEncapsulatedCompositeIdentifierDescription(querySpace) : buildNonEncapsulatedCompositeIdentifierDescription(querySpace);
}
Aggregations