• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructing a JPQLquery for entity class containing composite primary keys

 
deepak prasee
Greenhorn
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic