-->
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 query....
PostPosted: Sat May 03, 2008 2:14 pm 
Newbie

Joined: Sat May 03, 2008 2:04 pm
Posts: 1
I need help generating an HQL query :
String queryString = "from A_B_Link inner join"+
"A on A_B_Link.A_id=A.id "+
"B on A_B_Link.B_id=B.id"

The equivalent SQL query would be"
select * from A, B
where A.id=A_B_Link.A_id and B.id=A_B_Link.B_id;

Since I used Eclipse to generate POJO classes for my tables, I have many-to-many mapping for tables A and B.... so I have A.java and B.java, but no A_B_Links.java file.... But when I execute the query, does the program look for A_B_Links file?

The error I get is "org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: on near line 1, column 46 .......
Thanks.


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.