-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: HQL equivalent to this Sql Query
PostPosted: Thu Oct 27, 2011 2:45 am 
Newbie

Joined: Sun Oct 09, 2011 8:55 am
Posts: 3
Code:
select part.PaId,part.PaName,part.PaPartNumber,part.PaGroup from Part as part,(select
    PaId,PaGroup from Part where PaPartNumber='195-15-12750') as pa where pa.PaId=part.PaID 
    or pa.PaGroup=part.PaGroup


what is hql query for the above ?

Convert to HQL,but error occurs!

HQL:

Code:
Select part.ID,part.Name,part.PartNumber From Part as part,(Select par.ID,par.Group
    From Part as par Where par.PartNumber Like ?) as pa Where part.ID=pa.ID or 
    part.Group=pa.Group


Error:

Code:
SEVERE: line 1:73: unexpected token: (
    Oct 26, 2011 7:23:01 PM org.hibernate.hql.ast.ErrorCounter reportError
    SEVERE: line 1:98: unexpected token: From
    unexpected token: ( near line 1, column 73 [Select part.ID,part.Name,part.PartNumber
    From Depot.Entity.Part as part,(Select par.ID,par.Group From Depot.Entity.Part as par
    Where par.PartNumber Like ?) as pa Where part.ID=pa.ID or part.Group=pa.Group]
    [Ljava.lang.StackTraceElement;@1195c2b


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.