package org.hibernate.cfg.naming;
import org.hibernate.internal.util.StringHelper;
@Deprecated
public class LegacyJpaNamingStrategyDelegate extends LegacyNamingStrategyDelegateAdapter {
LegacyJpaNamingStrategyDelegate(LegacyNamingStrategyDelegate.LegacyNamingStrategyDelegateContext context) {
super( context );
}
@Override
public String determineImplicitPrimaryTableName(String entityName, String jpaEntityName) {
return getNamingStrategy().classToTableName( jpaEntityName );
}
@Override
public String determineImplicitElementCollectionTableName(
String ownerEntityName,
String ownerJpaEntityName,
String ownerEntityTable,
String propertyPath) {
return getNamingStrategy().collectionTableName(
ownerEntityName,
StringHelper.unqualifyEntityName( ownerEntityName ),
null,
null,
propertyPath
);
}
@Override
public String determineImplicitElementCollectionJoinColumnName(
String ownerEntityName, String ownerJpaEntityName, String ownerEntityTable, String referencedColumnName, String propertyPath) {
return getNamingStrategy().foreignKeyColumnName(
propertyPath,
ownerEntityName,
StringHelper.unqualifyEntityName( ownerEntityName ),
referencedColumnName
);
}
@Override
public String determineImplicitEntityAssociationJoinTableName(
String ownerEntityName,
String ownerJpaEntityName,
String ownerEntityTable,
String associatedEntityName,
String associatedJpaEntityName,
String associatedEntityTable,
String propertyPath) {
return getNamingStrategy().collectionTableName(
ownerEntityName,
ownerEntityTable,
associatedEntityName,
associatedEntityTable,
propertyPath
);
}
@Override
public String determineImplicitEntityAssociationJoinColumnName(
String propertyEntityName, String propertyJpaEntityName, String propertyTableName, String referencedColumnName, String propertyPath) {
return getNamingStrategy().foreignKeyColumnName(
propertyPath,
propertyEntityName,
propertyTableName,
referencedColumnName
);
}
@Override
public String determineLogicalElementCollectionTableName(
String tableName,
String ownerEntityName,
String ownerJpaEntityName,
String ownerEntityTable,
String propertyName) {
return getNamingStrategy().logicalCollectionTableName(
tableName,
ownerEntityName == null ? null : StringHelper.unqualifyEntityName( ownerEntityName ),
null,
propertyName
);
}
@Override
public String determineLogicalEntityAssociationJoinTableName(
String tableName,
String ownerEntityName,
String ownerJpaEntityName,
String ownerEntityTable,
String associatedEntityName,
String associatedJpaEntityName,
String associatedEntityTable,
String propertyName) {
return getNamingStrategy().logicalCollectionTableName(
tableName,
ownerEntityTable,
associatedEntityTable,
propertyName
);
}
}