Markus Heiden (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYTRmNjFhN2M5...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15713?atlOrigin=eyJpIjoiYTRmNj...
) HHH-15713 (
https://hibernate.atlassian.net/browse/HHH-15713?atlOrigin=eyJpIjoiYTRmNj...
) UnknownTableReferenceException on @ElementCollection of @Embeddable containing a
@MayToOne with a @ManyToMany (
https://hibernate.atlassian.net/browse/HHH-15713?atlOrigin=eyJpIjoiYTRmNj...
)
Change By: Markus Heiden (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
When “Hibernate.initialize(plan.getTransfers( ).get(0).getSubPlan().getEvents()) ” I get a
“UnknownTableReferenceException: Unable to determine TableReference (`SubPlan`) for
`Plan.transfers.events`”.
Hibernate seems to overlook the intermediate entity “SubPlan“ in the embeddable here. The
path above should be `Plan.transfers.subPlan.events`.
Reduced code:
{noformat}@Entity
public class Plan {
@ Id
public Integer id;
@ ElementCollection
@CollectionTable(name = "TRANSFER", joinColumns = @JoinColumn(name =
"PLAN_ID"))
private public List<Transfer> transfers;
public List<Transfer> getTransfers() {
return transfers;
}
}
@Embeddable
public class Transfer {
@ManyToOne
private @JoinColumn(name = "subplan_id")
@Cascade(ALL)
public SubPlan subPlan;
public SubPlan getSubPlan() {
return subPlan;
}
}
@Entity
public class SubPlan {
@ Id
public Integer id;
@ ManyToMany
private @Fetch(SUBSELECT)
@Cascade(ALL)
public List<Event> events = new ArrayList<>() ;
public List<Event> getEvents() {
return events;
}
}
@Entity
public class Event {
@Id
public Integer id;
public String name;
}{noformat}
(
https://hibernate.atlassian.net/browse/HHH-15713#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15713#add-comment?atlOrigin=ey...
)
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#100210- sha1:583150f )