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 3232import jakarta .persistence .ExcludeSuperclassListeners ;
3333import jakarta .persistence .MappedSuperclass ;
3434import jakarta .persistence .PersistenceException ;
35+ import org .hibernate .spi .NavigablePath ;
3536
3637import static org .hibernate .internal .log .DeprecationLogger .DEPRECATION_LOGGER ;
3738import static org .hibernate .internal .util .collections .CollectionHelper .isNotEmpty ;
@@ -282,7 +283,10 @@ public static void resolveLifecycleCallbacks(
282283 // code was added by HHH-12326
283284 collector .addSecondPass ( persistentClasses -> {
284285 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 ()) ) {
286290 try {
287291 final Class <?> mappedClass = persistentClass .getMappedClass ();
288292 for ( CallbackType type : CallbackType .values () ) {
You can’t perform that action at this time.
0 commit comments