This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes [JPA] EJBQL query returns replicated result of same record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[JPA] EJBQL query returns replicated result of same record" Watch "[JPA] EJBQL query returns replicated result of same record" New topic
Author

[JPA] EJBQL query returns replicated result of same record

antonio each
Greenhorn

Joined: Apr 05, 2011
Posts: 9
Hi all

this is my scenario:



So i have a NamedQuery on top of Car entity:




In my database I have only one car which have CAR_DESC = 'MONOVOLUME',but query return the same replicated result sixteen times!

I can't see any error in my code,can someone help me?

Thank you!
Antonio
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 513

Why are you not using carTypeId as a join condition?


If you are not laughing at yourself, then you just didn't get the joke.
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
What is the SQL generated?


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
 
wood burning stoves
 
subject: [JPA] EJBQL query returns replicated result of same record
 
Similar Threads
Hibernate: Can someone verify my mapping configuration?
Loop Problems
Retrieving "DiscriminatorColumn" value when querying an object
Abstract class example
[JPQL] UNION