Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Query on a attribute in the interface that is used for variable 1-1 mapping
Query on a attribute in the interface that is used for variable 1-1 mapping [message #933779] Fri, 05 October 2012 10:35 Go to next message
Rice Yeh is currently offline Rice YehFriend
Messages: 20
Registered: July 2009
Junior Member
Hi,
I am moving my project from hibernate to eclipselink because of its richer OR mapping. One of these mappings impresses me is the variable 1-1 relationship and seems that joining on the variable 1-1 relationship is supported (right?). However, I find that I cannot set a criteria based on an attribute on the interface used for the variable 1-1 relationship with no mapping for the attribute is found as show in the following section. Of course, I can use subquery to get my job done but if joining on the variable 1-1 supported, using subquery seems not over-skill.

java.lang.IllegalArgumentException: The attribute [number] from the managed type [EntityTypeImpl@178721701:Orderable [ javaType: interface xs.logistics.Orderable descriptor: RelationalDescriptor(xs.logistics.Orderable --> []), mappings: 0]] is not present.
at org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl.getAttribute(ManagedTypeImpl.java:147)
at org.eclipse.persistence.internal.jpa.querydef.FromImpl.get(FromImpl.java:312)

Rice
Re: Query on a attribute in the interface that is used for variable 1-1 mapping [message #933989 is a reply to message #933779] Fri, 05 October 2012 14:38 Go to previous messageGo to next message
Gordon Yorke is currently offline Gordon YorkeFriend
Messages: 78
Registered: July 2009
Member
Unfortunately joins across Variable One To One mappings is not supported. Some suggested workarounds can be found here: http://www.eclipse.org/forums/index.php/mv/msg/169394/538463/#msg_538463
Re: Query on a attribute in the interface that is used for variable 1-1 mapping [message #934008 is a reply to message #933989] Fri, 05 October 2012 14:59 Go to previous message
Rice Yeh is currently offline Rice YehFriend
Messages: 20
Registered: July 2009
Junior Member
I had a read on the workaround and thought that things must have changed since it was 2009. So have a post here.

Rice
Previous Topic:Hibernate migration
Next Topic:OneToMany is not working using composite key in JPA2.0 with Ecliselink
Goto Forum:
  


Current Time: Thu Apr 25 22:54:55 GMT 2024

Powered by FUDForum. Page generated in 0.03031 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top