@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { // JPA states we should use the following as default: // "The concatenation of the name of the containing entity and the name of the // collection attribute, separated by an underscore. // aka: // if owning entity has a JPA entity name: {OWNER JPA ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} // otherwise: {OWNER ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} final String entityName = transformEntityName( source.getOwningEntityNaming() ); final String name = entityName + '_' + transformAttributePath( source.getOwningAttributePath() ); return toIdentifier( name, source.getBuildingContext() ); }
@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { Identifier identifier = toIdentifier( source.getOwningPhysicalTableName().getText() + "_" + transformAttributePath( source.getOwningAttributePath() ), source.getBuildingContext() ); if ( source.getOwningPhysicalTableName().isQuoted() ) { identifier = Identifier.quote( identifier ); } return identifier; }
@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { // This impl uses the owner entity table name instead of the JPA entity name when // generating the implicit name. final String name = source.getOwningPhysicalTableName().getText() + '_' + transformAttributePath( source.getOwningAttributePath() ); return toIdentifier( name, source.getBuildingContext() ); }
@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { // JPA states we should use the following as default: // "The concatenation of the name of the containing entity and the name of the // collection attribute, separated by an underscore. // aka: // if owning entity has a JPA entity name: {OWNER JPA ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} // otherwise: {OWNER ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} final String entityName = transformEntityName( source.getOwningEntityNaming() ); final String name = entityName + '_' + transformAttributePath( source.getOwningAttributePath() ); return toIdentifier( name, source.getBuildingContext() ); }
@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { String ownerEntity = source.getOwningEntityNaming().getEntityName(); String ownerEntityTable = NamingStrategyUtils.unqualifyEntityName(ownerEntity); String associatedEntity = null; String associatedEntityTable = null; String propertyName = getPropertyName(source.getOwningAttributePath()); String result = hibernate4Strategy.collectionTableName(ownerEntity, ownerEntityTable, associatedEntity, associatedEntityTable, propertyName); return toIdentifier(result, source.getBuildingContext()); }
@Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { Identifier identifier = toIdentifier( source.getOwningPhysicalTableName().getText() + "_" + transformAttributePath( source.getOwningAttributePath() ), source.getBuildingContext() ); if ( source.getOwningPhysicalTableName().isQuoted() ) { identifier = Identifier.quote( identifier ); } return identifier; }