spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

POST_UPDATE not raised in OneToMany join

Open nallahdadi opened this issue 1 year ago • 1 comments

Hi, I have an entities like bellow:

@Entity
 @Table(name = "SET")
 @EntityListeners({EventEntityListener.class})
 public class SetEntity implements Serializable {
     @Id
     @Column(name = "ID")
     private Integer id;
 
     @Column(name = "TYPE")
     private ValueType valueType;
 
     @OneToMany(mappedBy = "setValueId.id", targetEntity = SetValueEntity.class,
             fetch = FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval = true)
     private List<SetValueEntity> setValues;
 }
@Embeddable
 public class SetValueID implements Serializable {
 
     @Column(name="ID")
     private Integer id;
 }

  @Entity
  @Table(name = "SET_VALUE")
  public class SetValueEntity implements Serializable {
  
      @EmbeddedId
      private SetValueID setValueId;
  
      @Column(name = "VALUE")
      private String setValue;
  }

I expected get POST_UPDATE, PRE_PERSIST and PRE_REMOVE event when call save on parent entity because of cascading all of operations. is there any solution to do this?

nallahdadi avatar Jul 01 '24 13:07 nallahdadi

This sounds very much like an issue with the persistence provider in use. Please try creating a reproducer that is using the plain EntityManager and potentially submit an issue in the JPA providers Bug Tracker.

If you think this is actually a Spring Data issue, please provide a reproducer for the issue including a test case that demonstrates the correct behaviour using the EntityManager directly.

christophstrobl avatar Jul 02 '24 05:07 christophstrobl

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Jul 09 '24 05:07 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Jul 16 '24 05:07 spring-projects-issues