@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { if ( source.getAssociationOwningAttributePath() != null ) { final String name = source.getOwningPhysicalTableName() + '_' + transformAttributePath( source.getAssociationOwningAttributePath() ); return toIdentifier( name, source.getBuildingContext() ); } return super.determineJoinTableName( source ); } }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { String name = source.getOwningPhysicalTableName() + "_" + source.getAssociationOwningAttributePath().getProperty(); return toIdentifier(name, source.getBuildingContext()); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { final String ownerPortion = source.getOwningPhysicalTableName(); final String ownedPortion; if ( source.getNonOwningPhysicalTableName() != null ) { ownedPortion = source.getNonOwningPhysicalTableName(); } else { ownedPortion = transformAttributePath( source.getAssociationOwningAttributePath() ); } return toIdentifier( ownerPortion + "_" + ownedPortion, source.getBuildingContext() ); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { final String ownerPortion = transformEntityName( source.getOwningEntityNaming() ); final String ownedPortion; if ( source.getNonOwningEntityNaming() != null ) { ownedPortion = transformEntityName( source.getNonOwningEntityNaming() ); } else { ownedPortion = transformAttributePath( source.getAssociationOwningAttributePath() ); } return toIdentifier( ownerPortion + "_" + ownedPortion, source.getBuildingContext() ); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { if ( source.getAssociationOwningAttributePath() != null ) { final String name = source.getOwningPhysicalTableName() + '_' + transformAttributePath( source.getAssociationOwningAttributePath() ); return toIdentifier( name, source.getBuildingContext() ); } return super.determineJoinTableName( source ); } }
@Override public Identifier determineJoinTableName(final ImplicitJoinTableNameSource source) { final String name = source.getOwningPhysicalTableName() + '_' + transformAttributePath(source.getAssociationOwningAttributePath()); return toIdentifier(name, source.getBuildingContext()); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { String name = source.getOwningPhysicalTableName() + "_" + source.getAssociationOwningAttributePath().getProperty(); return toIdentifier(name, source.getBuildingContext()); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { final String ownerPortion = source.getOwningPhysicalTableName(); final String ownedPortion; if ( source.getNonOwningPhysicalTableName() != null ) { ownedPortion = source.getNonOwningPhysicalTableName(); } else { ownedPortion = transformAttributePath( source.getAssociationOwningAttributePath() ); } return toIdentifier( ownerPortion + "_" + ownedPortion, source.getBuildingContext() ); }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { Identifier i = super.determineJoinTableName(source); LOGGER.trace("determineJoinTableName {} {} {} {} {} -> {}", source.getOwningEntityNaming(), source.getOwningPhysicalTableName(), source.getNonOwningEntityNaming(), source.getNonOwningPhysicalTableName(), source.getAssociationOwningAttributePath(), i); return i; }
@Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { String ownerEntity = source.getOwningEntityNaming().getEntityName(); String ownerEntityTable = NamingStrategyUtils.unqualifyEntityName(ownerEntity); String associatedEntity = source.getNonOwningEntityNaming().getEntityName(); String associatedEntityTable = NamingStrategyUtils.unqualifyEntityName(associatedEntity); String propertyName = getPropertyName(source.getAssociationOwningAttributePath()); String result = hibernate4Strategy.collectionTableName(ownerEntity, ownerEntityTable, associatedEntity, associatedEntityTable, propertyName); return toIdentifier(result, source.getBuildingContext()); }
/** * Generates a name for a join table. */ @Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { // TODO check String ownerEntityTable = source.getOwningPhysicalTableName(); String ownerEntityTable = source.getOwningEntityNaming().getEntityName(); String associatedEntityTable = source.getNonOwningEntityNaming().getEntityName(); String propertyName = getPropertyName(source.getAssociationOwningAttributePath()); String tableName = strategy.joinTableName(ownerEntityTable, associatedEntityTable); TableDescription description = new TableDescription(ownerEntityTable, associatedEntityTable, propertyName); String result = joinTableNames.hasSameNameForOtherProperty(tableName, description) ? strategy.joinTableName(ownerEntityTable, associatedEntityTable, propertyName) : tableName; joinTableNames.put(result, description); return toIdentifier(result, source); }