• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JPA @NamedNativeQuery and scalar results

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use a @NamedNativeQuery which return an intersect query.

Here is the mapping I was trying



Eventhough this query returns all the columns of a single table, its treated as scalar because of the intersect operator. Here is the exception I got



How can I map this query to a entity? Will something like this work? Also how do I handle the foreign key that is mapped (in bold)? Do I need to map the related entity in the resultSetMapping as well? When this resultset it returned will the entities be managed? Or will I have to merge them?


Here is the entity definition



Thanks!
[ September 26, 2007: Message edited by: Brian Smith ]
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic