File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
hibernate-core/src/main/java/org/hibernate/jpa/event/internal Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 32
32
import jakarta .persistence .ExcludeSuperclassListeners ;
33
33
import jakarta .persistence .MappedSuperclass ;
34
34
import jakarta .persistence .PersistenceException ;
35
+ import org .hibernate .spi .NavigablePath ;
35
36
36
37
import static org .hibernate .internal .log .DeprecationLogger .DEPRECATION_LOGGER ;
37
38
import static org .hibernate .internal .util .collections .CollectionHelper .isNotEmpty ;
@@ -282,7 +283,10 @@ public static void resolveLifecycleCallbacks(
282
283
// code was added by HHH-12326
283
284
collector .addSecondPass ( persistentClasses -> {
284
285
for ( Property property : persistentClass .getDeclaredProperties () ) {
285
- if ( property .isComposite () ) {
286
+ if ( property .isComposite ()
287
+ // this is to avoid issuing an embeddableLifecycleCallback warning in case the embedded property represents an IdClass (see HHH-19671)
288
+ // alternative way: collector.getClassDetailsRegistry().getClassDetails( property.getType().getReturnedClass().getName() ).hasDirectAnnotationUsage( IdClass.class )
289
+ && !NavigablePath .IDENTIFIER_MAPPER_PROPERTY .equals (property .getName ()) ) {
286
290
try {
287
291
final Class <?> mappedClass = persistentClass .getMappedClass ();
288
292
for ( CallbackType type : CallbackType .values () ) {
You can’t perform that action at this time.
0 commit comments