@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { // JPA states we should use the following as default: // // (1) if there is a "referencing relationship property": // "The concatenation of the following: the name of the referencing relationship // property or field of the referencing entity or embeddable class; "_"; the // name of the referenced primary key column." // // (2) if there is no such "referencing relationship property", or if the association is // an element collection: // "The concatenation of the following: the name of the entity; "_"; the name of the // referenced primary key column" // todo : we need to better account for "referencing relationship property" final String name; if ( source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null ) { name = transformEntityName( source.getEntityNaming() ) + '_' + source.getReferencedColumnName().getText(); } else { name = transformAttributePath( source.getAttributePath() ) + '_' + source.getReferencedColumnName().getText(); } return toIdentifier( name, source.getBuildingContext() ); }
if ( source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null ) { name = source.getReferencedTableName().getText() + '_' + source.getReferencedColumnName().getText(); name = transformAttributePath( source.getAttributePath() ) + '_' + source.getReferencedColumnName().getText(); return toIdentifier( name, source.getBuildingContext() );
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { if ( source.getAttributePath() != null ) { return toIdentifier( transformAttributePath( source.getAttributePath() ), source.getBuildingContext() ); } return super.determineJoinColumnName( source ); }
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { final String name = source.getReferencedTableName() + "_" + source.getReferencedColumnName(); return toIdentifier( name, source.getBuildingContext() ); } }
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { String propertyTableName = InternalUtils.ClassUtils .getShortName(source.getEntityNaming().getEntityName()); // a property name is null for join tables for an owner table foreign key String propertyName = getPropertyName(source.getAttributePath()); String result = strategy.foreignKeyColumnName(propertyName, propertyTableName); return toIdentifier(result, source); }
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { if ( source.getAttributePath() != null ) { return toIdentifier( transformAttributePath( source.getAttributePath() ), source.getBuildingContext() ); } return super.determineJoinColumnName( source ); }
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { final String entityPortion = transformEntityName( source.getEntityNaming() ); final String name; if ( source.getAttributePath() == null ) { name = entityPortion + "_" + source.getReferencedColumnName(); } else { name = entityPortion + "_" + transformAttributePath( source.getAttributePath() ) + "_" + source.getReferencedColumnName(); } return toIdentifier( name, source.getBuildingContext() ); } }
@Override public Identifier determineJoinColumnName(final ImplicitJoinColumnNameSource source) { if (source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null) { return source.getReferencedTableName(); } return toIdentifier(transformAttributePath(source.getAttributePath()), source.getBuildingContext()); }
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { final String name; if ( source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null ) { name = transformEntityName( source.getEntityNaming() ) + '_' + source.getReferencedColumnName(); } else { name = transformAttributePathCustom(source.getAttributePath()) + '_' + source.getReferencedColumnName(); } return toIdentifier( name, source.getBuildingContext() ); }
if ( source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null ) { name = source.getReferencedTableName().getText() + '_' + source.getReferencedColumnName().getText(); name = transformAttributePath( source.getAttributePath() ) + '_' + source.getReferencedColumnName().getText(); return toIdentifier( name, source.getBuildingContext() );
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { // JPA states we should use the following as default: // // (1) if there is a "referencing relationship property": // "The concatenation of the following: the name of the referencing relationship // property or field of the referencing entity or embeddable class; "_"; the // name of the referenced primary key column." // // (2) if there is no such "referencing relationship property", or if the association is // an element collection: // "The concatenation of the following: the name of the entity; "_"; the name of the // referenced primary key column" // todo : we need to better account for "referencing relationship property" final String name; if ( source.getNature() == ImplicitJoinColumnNameSource.Nature.ELEMENT_COLLECTION || source.getAttributePath() == null ) { name = transformEntityName( source.getEntityNaming() ) + '_' + source.getReferencedColumnName().getText(); } else { name = transformAttributePath( source.getAttributePath() ) + '_' + source.getReferencedColumnName().getText(); } return toIdentifier( name, source.getBuildingContext() ); }
AttributePath path = source.getAttributePath(); String property = path.getProperty(); String columnName = source.getReferencedColumnName().getText(); real = toIdentifier(name, source.getBuildingContext()); } else { real = toIdentifier(StringUtils.join(Arrays.asList(translatedParent, columnName), "_"), source.getBuildingContext()); LOGGER.trace("determineJoinColumnName {} {} -> {}, {}", source.getReferencedTableName(), source.getReferencedColumnName(), i, real);
@Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { String propertyName = getPropertyName(source.getAttributePath()); String propertyEntityName = source.getEntityNaming().getEntityName(); String propertyTableName = NamingStrategyUtils.unqualifyEntityName(propertyEntityName); String referencedColumnName = source.getReferencedColumnName().getText(); String result = hibernate4Strategy.foreignKeyColumnName(propertyName, propertyEntityName, propertyTableName, referencedColumnName); return toIdentifier(result, source.getBuildingContext()); }