I thinkg the answer is not correct.
@AssociationOverride(
name="cubeLocation.building",
joinColumns=@JoinColumn(name="BLDG_ID")
)
private CubeLocation cubeLocation;
cubeLocation.building should be replaced with "building" only, since you don't need to use the name of the field when placing AssociationOverride besides the field which relationship you wish to override.
Take a look at persistence-2_0-final-spec.pdf, examples 1 and 2 inside chapter 11.1.4
About Question enthuware.oce-jpad.v6.2.416 :
Moderators: Site Manager, fjwalraven
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.416 :
You are right, cubeLocation. is wrong here.
If cubeLocation were a field in a mapped super class of Employee, you would apply @AssociationOverride to the Employee class and the value of the name attribute would then be cubeLocation.building.
This has now been corrected. Thank you for your feedback!
If cubeLocation were a field in a mapped super class of Employee, you would apply @AssociationOverride to the Employee class and the value of the name attribute would then be cubeLocation.building.
This has now been corrected. Thank you for your feedback!
Re: About Question enthuware.oce-jpad.v6.2.416 :
also, why isn't C correct ? in my tests it works well
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.416 :
As per section 11.1.2:
When used to override a mapping defined by a mapped superclass, the AssociationOverride
annotation is applied to the entity class.
...
When used to override a relationship mapping defined by an embeddable class (including an embeddable class embedded within another embeddable class), the AssociationOverride annotation
is applied to the field or property containing the embeddable.
Re: About Question enthuware.oce-jpad.v6.2.416 :
In my tests it works, with implementation from Hibernate and EclipseLink.admin wrote:As per section 11.1.2:When used to override a mapping defined by a mapped superclass, the AssociationOverride
annotation is applied to the entity class.
...
When used to override a relationship mapping defined by an embeddable class (including an embeddable class embedded within another embeddable class), the AssociationOverride annotation
is applied to the field or property containing the embeddable.
Who is online
Users browsing this forum: No registered users and 4 guests