@Override public CascadeStyle determineCascadeStyle() { return getSource().getEntityPersister().getPropertyCascadeStyles()[attributeNumber()]; }
protected Joinable getJoinable() { if ( getAssociationNature() == AssociationNature.ANY ) { throw new WalkingException( "Cannot resolve AnyType to a Joinable" ); } if ( joinable == null ) { joinable = getType().getAssociatedJoinable( sessionFactory() ); } return joinable; }
@Override public CollectionDefinition toCollectionDefinition() { if ( getAssociationNature() == AssociationNature.ANY ) { throw new WalkingException( "Cannot treat any-type attribute as a collection type" ); } if ( getAssociationNature() == AssociationNature.ENTITY ) { throw new IllegalStateException( "Cannot treat entity-valued attribute as collection type" ); } return (QueryableCollection) getJoinable(); }
@Override public FetchStrategy determineFetchPlan(LoadQueryInfluencers loadQueryInfluencers, PropertyPath propertyPath) { final EntityPersister owningPersister = getSource().getEntityPersister(); FetchStyle style = FetchStrategyHelper.determineFetchStyleByProfile( loadQueryInfluencers, owningPersister, propertyPath, attributeNumber() ); if ( style == null ) { style = FetchStrategyHelper.determineFetchStyleByMetadata( ( (OuterJoinLoadable) getSource().getEntityPersister() ).getFetchMode( attributeNumber() ), getType(), sessionFactory() ); } return new FetchStrategy( FetchStrategyHelper.determineFetchTiming( style, getType(), sessionFactory() ), style ); }
@Override public AnyMappingDefinition toAnyDefinition() { return new StandardAnyTypeDefinition( (AnyType) getType(), getSource().getEntityMetamodel().getProperties()[ attributeNumber() ].isLazy() ); }
case ANY: case COLLECTION: { return new EntityBasedAssociationAttribute( persister, sessionFactory,
@Override public AssociationKey getAssociationKey() { final AssociationType type = getType(); JoinHelper.getLHSTableName( type, attributeNumber(), (OuterJoinLoadable) getSource() ), JoinHelper.getLHSColumnNames( type, attributeNumber(), 0, (OuterJoinLoadable) getSource(), sessionFactory() final Joinable joinable = type.getAssociatedJoinable( sessionFactory() ); final OuterJoinLoadable entityPersister = (OuterJoinLoadable) source(); lhsTableName = getLHSTableName( type, attributeNumber(), entityPersister ); lhsColumnNames = getLHSColumnNames( type, attributeNumber(), entityPersister, sessionFactory() ); return new AssociationKey( joinable.getTableName(), getRHSColumnNames( type, sessionFactory() ) );
@Override public EntityDefinition toEntityDefinition() { if ( getAssociationNature() == AssociationNature.ANY ) { throw new WalkingException( "Cannot treat any-type attribute as an entity type" ); } if ( getAssociationNature() == AssociationNature.COLLECTION ) { throw new IllegalStateException( "Cannot treat collection-valued attribute as entity type" ); } return (EntityPersister) getJoinable(); }