-
-
Notifications
You must be signed in to change notification settings - Fork 246
HSEARCH-5517 Adjust index plan updates caused by "association" for deleted entities #4887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a7668c3 to
2e1f0c0
Compare
...e/src/main/java/org/hibernate/search/mapper/pojo/work/impl/AbstractPojoTypeIndexingPlan.java
Show resolved
Hide resolved
| @JoinColumn(name = "PARENT_ID_CUSTOM_NAME") | ||
| @OneToOne | ||
| @IndexedEmbedded | ||
| @AssociationInverseSide(inversePath = @ObjectPath(@PropertyValue(propertyName = "cascadableChildMapsId"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary, there's already a mappedBy on the other side?
| CascadableChildMapsId child = session.find( CascadableChildMapsId.class, 1L ); | ||
| child.setName( "to-be-deleted" ); | ||
| session.persist( child ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call to persist is strange, as the entity is already persisted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah, missed it when cleaning up the reproducer, 👍🏻
...onetoone/ownedbycontaining/AutomaticIndexingOneToOneOwnedByContainingEagerOnBothSidesIT.java
Show resolved
Hide resolved
...e/src/main/java/org/hibernate/search/mapper/pojo/work/impl/AbstractPojoTypeIndexingPlan.java
Show resolved
Hide resolved
I don't think so ... if we start removing things explicitly without cascading, then ORM would force us to set nulls or we'll get Hibernate ORM exceptions about those dangling objects ... (I think we already have tests for that scenario in place)...
yeah... I only could get it to "fail" with this mapping, removing any other part of what's in was leading to a different oreder of remove events and all was "ok" in a sense that update was planned first but then the remove event from ORM came in and the final plan was correct ... 😖 |
2e1f0c0 to
4ebe234
Compare
|



https://hibernate.atlassian.net/browse/HSEARCH-5517
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.