private int getSubclassPropertyTableNumber(String propertyName, String entityName) { // When there are duplicated property names in the subclasses // then propertyMapping.toType( propertyName ) may return an // incorrect Type. To ensure correct results, lookup the property type // using the concrete EntityPersister with the specified entityName // (since the concrete EntityPersister cannot have duplicated property names). final EntityPersister concreteEntityPersister; if ( getEntityName().equals( entityName ) ) { concreteEntityPersister = this; } else { concreteEntityPersister = getFactory().getMetamodel().entityPersister( entityName ); } Type type = concreteEntityPersister.getPropertyType( propertyName ); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) { return 0; } final Integer tabnum = propertyTableNumbersByNameAndSubclass.get( entityName + '.' + propertyName ); return tabnum == null ? 0 : tabnum; }
int propertyIndex, OuterJoinLoadable lhsPersister) { if ( type.useLHSPrimaryKey() || propertyIndex < 0 ) { return lhsPersister.getTableName();
OuterJoinLoadable lhsPersister, Mapping mapping) { if ( type.useLHSPrimaryKey() ) {
if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); columnReaders = getIdentifierColumnReaders();
OuterJoinLoadable lhsPersister, Mapping mapping) { if ( associationType.useLHSPrimaryKey() ) { return StringHelper.qualify( columnQualifier, lhsPersister.getIdentifierColumnNames() );
if ( type.isAssociationType() ) { AssociationType assocType = (AssociationType) type; if ( assocType.useLHSPrimaryKey() ) {
private int getSubclassPropertyTableNumber(String propertyName, String entityName) { Type type = propertyMapping.toType(propertyName); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) return 0; final Integer tabnum = (Integer) propertyTableNumbersByNameAndSubclass.get(entityName + '.' + propertyName); return tabnum==null ? 0 : tabnum.intValue(); }
private int getSubclassPropertyTableNumber(String propertyName, String entityName) { Type type = propertyMapping.toType(propertyName); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) return 0; final Integer tabnum = (Integer) propertyTableNumbersByNameAndSubclass.get(entityName + '.' + propertyName); return tabnum==null ? 0 : tabnum.intValue(); }
private int getSubclassPropertyTableNumber(String propertyName, String entityName) { Type type = propertyMapping.toType(propertyName); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) return 0; final Integer tabnum = (Integer) propertyTableNumbersByNameAndSubclass.get(entityName + '.' + propertyName); return tabnum==null ? 0 : tabnum.intValue(); }
OuterJoinLoadable lhsPersister ) { if ( type.useLHSPrimaryKey() ) { return lhsPersister.getTableName();
OuterJoinLoadable lhsPersister ) { if ( type.useLHSPrimaryKey() ) { return lhsPersister.getTableName();
if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames();
Mapping mapping ) { if ( type.useLHSPrimaryKey() ) {
Mapping mapping ) { if ( type.useLHSPrimaryKey() ) {
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
/** * 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. */ protected int getSubclassPropertyTableNumber(String propertyName) { final String rootPropertyName = StringHelper.root(propertyName); Type type = propertyMapping.toType(rootPropertyName); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) { return 0; } if ( type.isComponentType() && !propertyName.equals(rootPropertyName) ) { String unrooted = StringHelper.unroot(propertyName); int idx = ArrayHelper.indexOf( getSubclassColumnClosure(), unrooted ); if ( idx != -1 ) { return getSubclassColumnTableNumberClosure()[idx]; } } int index = ArrayHelper.indexOf( getSubclassPropertyNameClosure(), rootPropertyName); //TODO: optimize this better! return index==-1 ? 0 : getSubclassPropertyTableNumber(index); }
if ( type.isAssociationType() ) { AssociationType assocType = ( AssociationType ) type; if ( assocType.useLHSPrimaryKey() ) {