rename some methods to reduce confusion

This commit is contained in:
Gavin 2022-11-27 11:23:10 +01:00 committed by Gavin King
parent 759b68b022
commit f2c81b0eaf
3 changed files with 15 additions and 12 deletions

View File

@ -205,9 +205,9 @@ public class AnnotatedJoinColumn extends AnnotatedColumn {
}
/**
* Build JoinColumn for a JOINED hierarchy
* Called for {@link jakarta.persistence.InheritanceType#JOINED} entities.
*/
public static AnnotatedJoinColumn buildJoinColumn(
public static AnnotatedJoinColumn buildInheritanceJoinColumn(
PrimaryKeyJoinColumn primaryKeyJoinColumn,
JoinColumn joinColumn,
Value identifier,
@ -216,11 +216,11 @@ public class AnnotatedJoinColumn extends AnnotatedColumn {
final String defaultColumnName = context.getMetadataCollector()
.getLogicalColumnName( identifier.getTable(), identifier.getColumns().get(0).getQuotedName() );
return primaryKeyJoinColumn != null || joinColumn != null
? explicitJoinColumn( primaryKeyJoinColumn, joinColumn, parent, context, defaultColumnName )
: implicitJoinColumn( parent, context, defaultColumnName );
? buildExplicitInheritanceJoinColumn( primaryKeyJoinColumn, joinColumn, parent, context, defaultColumnName )
: buildImplicitInheritanceJoinColumn( parent, context, defaultColumnName );
}
private static AnnotatedJoinColumn explicitJoinColumn(
private static AnnotatedJoinColumn buildExplicitInheritanceJoinColumn(
PrimaryKeyJoinColumn primaryKeyJoinColumn,
JoinColumn joinColumn,
AnnotatedJoinColumns parent,
@ -259,7 +259,7 @@ public class AnnotatedJoinColumn extends AnnotatedColumn {
return column;
}
private static AnnotatedJoinColumn implicitJoinColumn(
private static AnnotatedJoinColumn buildImplicitInheritanceJoinColumn(
AnnotatedJoinColumns parent,
MetadataBuildingContext context,
String defaultColumnName ) {

View File

@ -170,6 +170,9 @@ public class AnnotatedJoinColumns extends AnnotatedColumns {
return parent;
}
/**
* Called for join tables in {@link jakarta.persistence.ManyToMany} associations.
*/
public static AnnotatedJoinColumns buildJoinTableJoinColumns(
JoinColumn[] joinColumns,
Map<String, Join> secondaryTables,

View File

@ -138,7 +138,7 @@ import org.hibernate.persister.entity.EntityPersister;
import org.jboss.logging.Logger;
import static org.hibernate.cfg.AnnotatedDiscriminatorColumn.buildDiscriminatorColumn;
import static org.hibernate.cfg.AnnotatedJoinColumn.buildJoinColumn;
import static org.hibernate.cfg.AnnotatedJoinColumn.buildInheritanceJoinColumn;
import static org.hibernate.cfg.BinderHelper.getMappedSuperclassOrNull;
import static org.hibernate.cfg.BinderHelper.getOverridableAnnotation;
import static org.hibernate.cfg.BinderHelper.hasToOneAnnotation;
@ -937,7 +937,7 @@ public class EntityBinder {
final PrimaryKeyJoinColumn[] columns = primaryKeyJoinColumns.value();
if ( columns.length > 0 ) {
for ( PrimaryKeyJoinColumn column : columns ) {
buildJoinColumn(
buildInheritanceJoinColumn(
column,
null,
superEntity.getIdentifier(),
@ -947,7 +947,7 @@ public class EntityBinder {
}
}
else {
buildJoinColumn(
buildInheritanceJoinColumn(
clazzToProcess.getAnnotation( PrimaryKeyJoinColumn.class ),
null,
superEntity.getIdentifier(),
@ -957,7 +957,7 @@ public class EntityBinder {
}
}
else {
buildJoinColumn(
buildInheritanceJoinColumn(
clazzToProcess.getAnnotation( PrimaryKeyJoinColumn.class ),
null,
superEntity.getIdentifier(),
@ -1689,7 +1689,7 @@ public class EntityBinder {
joinColumns.setBuildingContext( context );
joinColumns.setJoins( secondaryTables );
joinColumns.setPropertyHolder( propertyHolder );
buildJoinColumn(
buildInheritanceJoinColumn(
null,
null,
persistentClass.getIdentifier(),
@ -1715,7 +1715,7 @@ public class EntityBinder {
for ( int colIndex = 0; colIndex < joinColumnCount; colIndex++ ) {
final PrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns != null ? primaryKeyJoinColumns[colIndex] : null;
final JoinColumn joinColumn = joinColumns != null ? joinColumns[colIndex] : null;
buildJoinColumn(
buildInheritanceJoinColumn(
primaryKeyJoinColumn,
joinColumn,
persistentClass.getIdentifier(),