Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiNzU2MmQ4...
) / Improvement (
https://hibernate.atlassian.net/browse/HSEARCH-4817?atlOrigin=eyJpIjoiNzU...
) HSEARCH-4817 (
https://hibernate.atlassian.net/browse/HSEARCH-4817?atlOrigin=eyJpIjoiNzU...
) Don't require bi-directional associations for @IndexedEmbedded/bridges that extract
the ID from the target of an association on the owning side (
https://hibernate.atlassian.net/browse/HSEARCH-4817?atlOrigin=eyJpIjoiNzU...
)
Issue Type: Improvement Assignee: Unassigned Components: mapper-orm, mapper-pojo-base
Created: 07/Mar/2023 22:58 PM Fix Versions: 7.x-backlog Priority: Major Reporter: Yoann
Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
E.g. with something like this:
public class MyEntity {
@Id
private Long id;
@OneToMany
@IndexedEmbedded(includeEmbeddedObjectIds = true, includeDepth = 0)
private List<MyOtherEntity> targets
}
public class MyOtherEntity {
@Id
private Long id;
}
Or like this:
public class MyEntity {
@Id
private Long id;
@OneToMany
// Assuming this bridge only depends on the ID
@PropertyBinding(bridge = @PropertyBridgeRef(type = MyOtherEntityIdBridge.class))
private List<MyOtherEntity> targets;
}
public class MyOtherEntity {
@Id
private Long id;
}
We know the entity ID is immutable, so there is no reason to have a reindexing resolver
that reindexes MyEntity when MyOtherEntity changes, so there is no need for an inverse
side for the targets association.
And yet, at the moment Hibernate Search will reject this mapping and complain the inverse
side of the targets association is missing.
This would be a special case of
https://hibernate.atlassian.net/browse/HSEARCH-4796 (
https://hibernate.atlassian.net/browse/HSEARCH-4796 ) , probably simpler to handle, but
eventually we’ll want to use similar metadata for both issues.
(
https://hibernate.atlassian.net/browse/HSEARCH-4817#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4817#add-comment?atlOrigin...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:45db922 )