/** * @deprecated Use {@link TypeConfiguration}/{@link TypeConfiguration.Scope} instead */ @Deprecated public interface TypeScope extends Serializable { TypeConfiguration getTypeConfiguration(); }
private Type getCommonType(MetadataImplementor metadata, EntityType entityType1, EntityType entityType2) { PersistentClass thisClass = metadata.getEntityBinding( entityType1.getAssociatedEntityName() ); PersistentClass otherClass = metadata.getEntityBinding( entityType2.getAssociatedEntityName() ); PersistentClass commonClass = getCommonPersistentClass( thisClass, otherClass ); if ( commonClass == null ) { return null; } // Create a copy of the type but with the common class if ( entityType1 instanceof ManyToOneType ) { ManyToOneType t = (ManyToOneType) entityType1; return new ManyToOneType( t, commonClass.getEntityName() ); } else if ( entityType1 instanceof SpecialOneToOneType ) { SpecialOneToOneType t = (SpecialOneToOneType) entityType1; return new SpecialOneToOneType( t, commonClass.getEntityName() ); } else if ( entityType1 instanceof OneToOneType ) { OneToOneType t = (OneToOneType) entityType1; return new OneToOneType( t, commonClass.getEntityName() ); } else { throw new IllegalStateException( "Unexpected entity type: " + entityType1 ); } }
public EntityType oneToOne( String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, String entityName, String propertyName) { return new OneToOneType( typeScope, persistentClass, foreignKeyType, uniqueKeyPropertyName, lazy, unwrapProxy, isEmbeddedInXML, entityName, propertyName ); }
public EntityType oneToOne( String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, String entityName, String propertyName) { return new OneToOneType( typeScope, persistentClass, foreignKeyType, uniqueKeyPropertyName, lazy, unwrapProxy, isEmbeddedInXML, entityName, propertyName ); }
/** * A one-to-one association type for the given class */ public static EntityType oneToOne( String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean isEmbeddedInXML, String entityName, String propertyName ) { return new OneToOneType( persistentClass, foreignKeyType, uniqueKeyPropertyName, lazy, isEmbeddedInXML, entityName, propertyName ); }
/** * A one-to-one association type for the given class */ public static EntityType oneToOne( String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, String entityName, String propertyName ) { return new OneToOneType( persistentClass, foreignKeyType, uniqueKeyPropertyName, lazy, unwrapProxy, isEmbeddedInXML, entityName, propertyName ); }