java - Unmapped composite object using hibernate -


i'd convert sql query use hql (or, if not possible, native query). unfortunately having issues particular query uses join. here's query in question:

select  p.externalid, p.hiddenscore, h.score weeklyscore, p.score alltimescore, (p.victories + p.defeats) matchplayed, cast(p.victories float) / (p.victories + p.defeats) ratio ygo..arena_playerregistry p join ygo..leaderboard_highscoreweekly h on p.externalid = h.externalid h.dateadded between '2014-01-01' , '2014-01-02'     , (p.victories + p.defeats) > 35     , h.score > 0 order weeklyscore desc 

i have tried following (and few variations thereof):

typedquery<leaderboardplayerpojo> query = em.createquery(     "select new model.composite.arena.leaderboardplayerpojo(p.externalid, p.hiddenscore, h.score, p.score, (p.victories + p.defeats), p.victories / (p.victories + p.defeats)) " +     "from arenaplayerregistry p " +     "join leaderboardhighscoreweekly h " +     "with h.externalid = p.externalid " +     "where h.dateadded between :startdate , :enddate " +     "and (p.victories + p.defeats) > 35 " +     "and h.score > 0 " +     "order h.score desc"     , leaderboardplayerpojo.class); 

i exception saying path expected join!

any suggestions appreciated!

edit: clarify, leaderboardplayerpojo class exists content holder request.

you can rewrite jpql as:

select new model.composite.arena.leaderboardplayerpojo(p.externalid, p.hiddenscore, h.score, p.score, (p.victories + p.defeats), p.victories / (p.victories + p.defeats)) arenaplayerregistry p,      leaderboardhighscoreweekly h h.externalid = p.externalid   , h.dateadded between :startdate , :enddate   , (p.victories + p.defeats) > 35   , h.score > 0 order h.score desc 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -