Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Constructing a JPQLquery for entity class containing composite primary keys

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

I would like to construct one query in JPAQL .Below is the exact scenario

My table is like

ObjectId(PK) Type(PK) location adresss
1 0 xxx yyyy
1 1 xxxx yyyyyyy
1 2 sdae wwwww

In the above table objectId and Type are primary keys.So i created the entity called Object with objectId and type as the embedded primary key...

Another table will be like below

ObjectId (PK) Level
1 0

In this table objectId is primary key and the level is an mapped as an enum (0-High,1-Very high)

I would like to get the output as

1 0 xxx yyyy 1 xxxx yyyyyyy 2 sdae wwwww High

Could any one assist me in getting this one
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic