Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hibernate/hibernate-orm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.6.10
Choose a base ref
...
head repository: hibernate/hibernate-orm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.6.11
Choose a head ref
  • 19 commits
  • 31 files changed
  • 7 contributors

Commits on Mar 9, 2025

  1. Post-steps for release : 6.6.10.Final

    Hibernate-CI committed Mar 9, 2025
    Copy the full SHA
    702d154 View commit details

Commits on Mar 13, 2025

  1. HHH-19220 Add test for issue

    dreab8 authored and sebersole committed Mar 13, 2025
    Copy the full SHA
    d02c69e View commit details
  2. HHH-19220 ClassCastException: class org.hibernate.bytecode.enhance.sp…

    …i.LazyPropertyInitializer cannot be cast to class java.lang.String
    dreab8 authored and sebersole committed Mar 13, 2025
    Copy the full SHA
    1cd67d3 View commit details
  3. HHH-19107 fix @EmbeddedId with CrudRepository

    (cherry picked from commit 05677eb)
    
    Signed-off-by: Damiano Renfer <x9w2n7xnu@relay.firefox.com>
    gavinking authored and mbladel committed Mar 13, 2025
    Copy the full SHA
    605f389 View commit details
  4. Copy the full SHA
    ecc5723 View commit details
  5. HHH-18894 Create and return new EnumJavaType object if class name rep…

    …resents enum that is not currently known
    cigaly authored and beikov committed Mar 13, 2025
    Copy the full SHA
    98defd9 View commit details
  6. Copy the full SHA
    37a9809 View commit details

Commits on Mar 14, 2025

  1. Copy the full SHA
    f212ddb View commit details
  2. HHH-19106 deconstruct inherited annotations before printing them

    (cherry-picked from commit 225d9b3)
    
    Signed-off-by: Damiano Renfer <x9w2n7xnu@relay.firefox.com>
    gavinking authored and beikov committed Mar 14, 2025
    Copy the full SHA
    68f65b5 View commit details
  3. HHH-19140 Reproducer test and issue fix (#9758)

    * HHH-19140 Add test case
    
    * HHH-19140 Fix for issue
    VladoKuruc authored and beikov committed Mar 14, 2025
    Copy the full SHA
    3635a49 View commit details
  4. Copy the full SHA
    148995c View commit details
  5. HHH-18858 Array annotated with one of @manytomany, @onetomany, or @El…

    …ementCollection should be represented with ListAttribute, not SingularAttribute
    cigaly authored and beikov committed Mar 14, 2025
    Copy the full SHA
    e54b125 View commit details
  6. Copy the full SHA
    d259836 View commit details
  7. HHH-18570 reallow use of 'date' and 'time' as regular column names in…

    … parsed SQL
    
    attempt to simplify the logic here
    
    Signed-off-by: Gavin King <gavin@hibernate.org>
    gavinking authored and beikov committed Mar 14, 2025
    Copy the full SHA
    10794a4 View commit details
  8. HHH-18787 Test case

    cigaly authored and beikov committed Mar 14, 2025
    Copy the full SHA
    8cf34b5 View commit details
  9. HHH-18787 Contribute type using returnedClass().getTypeName() instead…

    … of returnedClass().getName()
    cigaly authored and beikov committed Mar 14, 2025
    Copy the full SHA
    b5c0f3c View commit details
  10. Copy the full SHA
    b34c519 View commit details
  11. Copy the full SHA
    f75a1f3 View commit details

Commits on Mar 16, 2025

  1. Copy the full SHA
    92ceb16 View commit details
Showing with 1,733 additions and 323 deletions.
  1. +19 −2 changelog.txt
  2. +1 −1 gradle/version.properties
  3. +1 −1 hibernate-core/src/main/java/org/hibernate/boot/model/TypeContributions.java
  4. +15 −1 hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/JpaMetamodelImpl.java
  5. +4 −86 hibernate-core/src/main/java/org/hibernate/property/access/internal/AccessStrategyHelper.java
  6. +9 −0 hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java
  7. +204 −200 hibernate-core/src/main/java/org/hibernate/sql/Template.java
  8. +1 −8 hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimestampJavaType.java
  9. +153 −0 ...src/test/java/org/hibernate/orm/test/bytecode/enhancement/access/HierarchyPropertyAccessTest.java
  10. +209 −0 hibernate-core/src/test/java/org/hibernate/orm/test/entitygraph/EntityGraphAndJoinFetchTest.java
  11. +129 −0 hibernate-core/src/test/java/org/hibernate/orm/test/joinsubquery/JoinSubqueryTest.java
  12. +172 −0 hibernate-core/src/test/java/org/hibernate/orm/test/mapping/array/MySqlArrayOfTimestampsTest.java
  13. +66 −0 hibernate-core/src/test/java/org/hibernate/orm/test/query/SelectUnknownEnumLiteralTest.java
  14. +32 −16 hibernate-core/src/test/java/org/hibernate/orm/test/sql/TemplateTest.java
  15. +36 −0 ...nate-core/src/test/java/org/hibernate/orm/test/type/contributor/usertype/hhh18787/CustomData.java
  16. +98 −0 ...-core/src/test/java/org/hibernate/orm/test/type/contributor/usertype/hhh18787/CustomDataType.java
  17. +50 −0 ...nate-core/src/test/java/org/hibernate/orm/test/type/contributor/usertype/hhh18787/SomeEntity.java
  18. +22 −0 ...ore/src/test/java/org/hibernate/orm/test/type/contributor/usertype/hhh18787/TypesContributor.java
  19. +59 −0 ...java/org/hibernate/orm/test/type/contributor/usertype/hhh18787/UserTypeNotRecognisedTestCase.java
  20. +21 −0 hibernate-envers/src/main/java/org/hibernate/envers/event/spi/EnversPostUpdateEventListenerImpl.java
  21. +100 −0 hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/lazy/LazyFieldsTest.java
  22. +5 −3 tooling/metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/eg/Bookshop.java
  23. +26 −0 ...l-generator/src/jakartaData/java/org/hibernate/processor/test/data/embeddedid/EmbeddedIdTest.java
  24. +20 −0 .../metamodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/embeddedid/Thing.java
  25. +15 −0 ...amodel-generator/src/jakartaData/java/org/hibernate/processor/test/data/embeddedid/ThingRepo.java
  26. +67 −3 tooling/metamodel-generator/src/main/java/org/hibernate/processor/ClassWriter.java
  27. +1 −1 ...ng/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
  28. +8 −1 ...el-generator/src/main/java/org/hibernate/processor/annotation/MetaAttributeGenerationVisitor.java
  29. +91 −0 tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/hhh18858/ArrayTest.java
  30. +37 −0 tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/hhh18858/Competitor.java
  31. +62 −0 tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/hhh18858/Contest.java
21 changes: 19 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -3,6 +3,25 @@ Hibernate 6 Changelog

Note: Please refer to JIRA to learn more about each issue.

Changes in 6.6.11.Final (March 16, 2025)
------------------------------------------------------------------------------------------------------------------------

https://hibernate.atlassian.net/projects/HHH/versions/32879

** Bug
* [HHH-19246] - Fetch join makes partially covered EntityGraph ineffective
* [HHH-19220] - ClassCastException: class org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer$1 cannot be cast to class java.lang.String
* [HHH-19140] - Enhanced entities with AccessType.PROPERTY does not work well with inheritance
* [HHH-19107] - Entities with @EmbeddedId not supported with CrudRepository
* [HHH-19106] - @Transaction(TxType) not working with Hibernate Data Repositories
* [HHH-19052] - Hibernate 6.6.X regression with join formula
* [HHH-18894] - Hibernate 6.6 enum literal is considered field literal instead
* [HHH-18881] - In MySQL, array of dates are not converted correctly
* [HHH-18858] - array fields and static metamodel
* [HHH-18787] - Custom UserType not recognised for array properties
* [HHH-18570] - Invalid SQL when filter contains identifier named date


Changes in 6.6.10.Final (March 09, 2025)
------------------------------------------------------------------------------------------------------------------------

@@ -24,8 +43,6 @@ https://hibernate.atlassian.net/projects/HHH/versions/32614

** Bug
* [HHH-19173] - PostgreSQLLegacySqlAstTranslator does not implement visitInArrayPredicates
* [HHH-19169] - Entity hierarchy (and included embeddables) with inconsistent bytecode enhancement is unsupported, but isn't detected
* [HHH-19168] - Re-enhancement of entities with different configuration may skip some enhancements
* [HHH-19116] - Error when using fk() function on left joined many-to-one association and is null predicate
* [HHH-19110] - Flush operation fails with "UnsupportedOperationException: compare() not implemented for EntityType"
* [HHH-17151] - NPE when binding null parameter in native query with explicit TemporalType
2 changes: 1 addition & 1 deletion gradle/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hibernateVersion=6.6.10.Final
hibernateVersion=6.6.11.Final
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ default void contributeJdbcTypeConstructor(JdbcTypeConstructor typeConstructor)
* type for values of type {@link UserType#returnedClass()}.
*/
default void contributeType(UserType<?> type) {
contributeType( type, type.returnedClass().getName() );
contributeType( type, type.returnedClass().getTypeName() );
}

/**
Original file line number Diff line number Diff line change
@@ -289,7 +289,21 @@ public Set<EmbeddableType<?>> getEmbeddables() {

@Override
public EnumJavaType<?> getEnumType(String className) {
return enumJavaTypes.get( className );
final EnumJavaType<?> enumJavaType = enumJavaTypes.get( className );
if ( enumJavaType != null ) {
return enumJavaType;
}
final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
try {
final Class<Object> clazz = classLoaderService.classForName( className );
if ( clazz == null || !clazz.isEnum() ) {
return null;
}
return new EnumJavaType( clazz );
}
catch (ClassLoadingException e) {
throw new RuntimeException( e );
}
}

@Override
Original file line number Diff line number Diff line change
@@ -6,14 +6,11 @@
*/
package org.hibernate.property.access.internal;

import java.beans.Introspector;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Locale;

import org.hibernate.MappingException;
import org.hibernate.PropertyNotFoundException;
import org.hibernate.bytecode.enhance.spi.interceptor.BytecodeLazyAttributeInterceptor;
import org.hibernate.engine.spi.CompositeOwner;
@@ -33,6 +30,7 @@
import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptableType;
import static org.hibernate.internal.util.ReflectHelper.NO_PARAM_SIGNATURE;
import static org.hibernate.internal.util.ReflectHelper.findField;
import static org.hibernate.internal.util.ReflectHelper.getterMethodOrNull;
import static org.hibernate.internal.util.ReflectHelper.isRecord;

/**
@@ -87,89 +85,9 @@ public static AccessType getAccessType(Class<?> containerJavaType, String proper
return AccessType.FIELD;
}

for ( Method method : containerClass.getDeclaredMethods() ) {
// if the method has parameters, skip it
if ( method.getParameterCount() != 0 ) {
continue;
}

// if the method is a "bridge", skip it
if ( method.isBridge() ) {
continue;
}

if ( method.isAnnotationPresent( Transient.class ) ) {
continue;
}

if ( Modifier.isStatic( method.getModifiers() ) ) {
continue;
}

final String methodName = method.getName();

// try "get"
if ( methodName.startsWith( "get" ) ) {
final String stemName = methodName.substring( 3 );
final String decapitalizedStemName = Introspector.decapitalize( stemName );
if ( stemName.equals( propertyName ) || decapitalizedStemName.equals( propertyName ) ) {
if ( method.isAnnotationPresent( Access.class ) ) {
return AccessType.PROPERTY;
}
else {
checkIsMethodVariant( containerClass, propertyName, method, stemName );
}
}
}

// if not "get", then try "is"
if ( methodName.startsWith( "is" ) ) {
final String stemName = methodName.substring( 2 );
String decapitalizedStemName = Introspector.decapitalize( stemName );
if ( stemName.equals( propertyName ) || decapitalizedStemName.equals( propertyName ) ) {
if ( method.isAnnotationPresent( Access.class ) ) {
return AccessType.PROPERTY;
}
}
}
}

return null;
}

private static void checkIsMethodVariant(
Class<?> containerClass,
String propertyName,
Method method,
String stemName) {
final Method isMethodVariant = findIsMethodVariant( containerClass, stemName );
if ( isMethodVariant == null ) {
return;
}

if ( !isMethodVariant.isAnnotationPresent( Access.class ) ) {
throw new MappingException(
String.format(
Locale.ROOT,
"Class '%s' declares both 'get' [%s] and 'is' [%s] variants of getter for property '%s'",
containerClass.getName(),
method.toString(),
isMethodVariant,
propertyName
)
);
}
}

public static @Nullable Method findIsMethodVariant(Class<?> containerClass, String stemName) {
// verify that the Class does not also define a method with the same stem name with 'is'
try {
final Method isMethod = containerClass.getDeclaredMethod( "is" + stemName );
if ( !Modifier.isStatic( isMethod.getModifiers() ) && isMethod.getAnnotation( Transient.class ) == null ) {
return isMethod;
}
}
catch (NoSuchMethodException ignore) {
final Method getter = getterMethodOrNull( containerClass, propertyName );
if ( getter != null && getter.isAnnotationPresent( Access.class ) ) {
return AccessType.PROPERTY;
}

return null;
Original file line number Diff line number Diff line change
@@ -8352,6 +8352,15 @@ private Fetch createFetch(FetchParent fetchParent, Fetchable fetchable, Boolean
joined = true;
alias = fetchedJoin.getExplicitAlias();
explicitFetch = true;

if ( entityGraphTraversalState != null ) {
// Still do traverse the entity graph even if we encounter a fetch join
traversalResult = entityGraphTraversalState.traverse(
fetchParent,
fetchable,
isKeyFetchable
);
}
}
else {
fetchablePath = resolvedNavigablePath;
Loading