Skip to content

Commit efd6c90

Browse files
committed
three minor cleanups in mapping/binding
1 parent 227caea commit efd6c90

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ private Set<String> handleIdClass(
452452
ElementsToProcess elementsToProcess,
453453
Map<ClassDetails, InheritanceState> inheritanceStates) {
454454
final Set<String> idPropertiesIfIdClass = new HashSet<>();
455-
boolean isIdClass = mapAsIdClass(
455+
final boolean isIdClass = mapAsIdClass(
456456
inheritanceStates,
457457
inheritanceState,
458458
persistentClass,
@@ -493,9 +493,9 @@ private boolean mapAsIdClass(
493493
final PropertyData baseInferredData = new PropertyPreloadedData( accessType, "id", classWithIdType );
494494
final AccessType propertyAccessor = getPropertyAccessor( compositeClass );
495495

496-
// In JPA 2, there is a shortcut if the IdClass is the Pk of the associated class pointed to by the id
496+
// In JPA 2, there is a shortcut if the IdClass is the PK of the associated class pointed to by the id
497497
// it ought to be treated as an embedded and not a real IdClass (at least in Hibernate's internal way)
498-
final boolean isFakeIdClass = isIdClassPkOfTheAssociatedEntity(
498+
final boolean isFakeIdClass = isIdClassPrimaryKeyOfAssociatedEntity(
499499
elementsToProcess,
500500
compositeClass,
501501
inferredData,
@@ -657,7 +657,7 @@ private static PropertyData getUniqueIdPropertyFromBaseClass(
657657
return baseClassElements.get( 0 );
658658
}
659659

660-
private static boolean isIdClassPkOfTheAssociatedEntity(
660+
private static boolean isIdClassPrimaryKeyOfAssociatedEntity(
661661
ElementsToProcess elementsToProcess,
662662
ClassDetails compositeClass,
663663
PropertyData inferredData,
@@ -672,7 +672,8 @@ private static boolean isIdClassPkOfTheAssociatedEntity(
672672
propertyAccessor,
673673
context
674674
);
675-
final InheritanceState state = inheritanceStates.get( idPropertyOnBaseClass.getClassOrElementType().determineRawClass() );
675+
final InheritanceState state =
676+
inheritanceStates.get( idPropertyOnBaseClass.getClassOrElementType().determineRawClass() );
676677
if ( state == null ) {
677678
return false; //while it is likely a user error, let's consider it is something that might happen
678679
}

hibernate-core/src/main/java/org/hibernate/mapping/PersistentClass.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.hibernate.annotations.CacheLayout;
2020
import org.hibernate.boot.Metadata;
2121
import org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
22-
import org.hibernate.boot.spi.ClassLoaderAccess;
2322
import org.hibernate.boot.spi.MetadataBuildingContext;
2423
import org.hibernate.dialect.Dialect;
2524
import org.hibernate.engine.OptimisticLockStyle;
@@ -159,10 +158,6 @@ public void setProxyInterfaceName(String proxyInterfaceName) {
159158
this.proxyInterface = null;
160159
}
161160

162-
private ClassLoaderAccess getClassLoaderAccess() {
163-
return metadataBuildingContext.getBootstrapContext().getClassLoaderAccess();
164-
}
165-
166161
public Class<?> getMappedClass() throws MappingException {
167162
if ( className == null ) {
168163
return null;

hibernate-core/src/main/java/org/hibernate/mapping/RootClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public void setEmbeddedIdentifier(boolean embeddedIdentifier) {
209209
/**
210210
* @deprecated No longer supported
211211
*/
212-
@Deprecated
212+
@Deprecated(since = "7", forRemoval = true)
213213
public void setExplicitPolymorphism(boolean explicitPolymorphism) {
214214
}
215215

0 commit comments

Comments
 (0)