}
@Override
public EntityDefinition toEntityDefinition() {
if ( getAssociationNature() != AssociationNature.ENTITY ) {
throw new WalkingException(
"Cannot build EntityDefinition from non-entity-typed attribute"
);
}
return (EntityPersister) aType.getAssociatedJoinable( ownerEntityPersister.getFactory() );
}
@Override
public AnyMappingDefinition toAnyDefinition() {
if ( getAssociationNature() != AssociationNature.ANY ) {
throw new WalkingException(
"Cannot build AnyMappingDefinition from non-any-typed attribute"
);
}
// todo : not sure how lazy is propogated into the component for a subattribute of type any
return new StandardAnyTypeDefinition( (AnyType) aType, false );
}
@Override
public CollectionDefinition toCollectionDefinition() {
throw new WalkingException( "A collection cannot be mapped to a composite ID sub-attribute." );
}
@Override
public FetchStrategy determineFetchPlan(LoadQueryInfluencers loadQueryInfluencers, PropertyPath propertyPath) {
return new FetchStrategy( FetchTiming.IMMEDIATE, FetchStyle.JOIN );