Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

I want to join three tables using DetachedCriteria

 
Mansi Mishra
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have three tables, namely Table1.class, Table2.class and Table3.class
They are each related to each other by foreign key references, say
Table1.C1=Table2.C1
Table2.C2=Table3.C2
Table1.C3=Table3.C3

I want to join these three tables to get columns C1,C2,C3...using DetachedCriteria and Projections...Any help is appreciated.

Thanks in advance
Mansi
 
Amit Ghorpade
Bartender
Posts: 2851
10
Fedora Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
"mansi speaking" welcome to Javaranch
please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
JayPrakash Dutta
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi ,
Can any one help me an execution this query having JOIN using DetachedCriteria .
There two diffrent Table.
1) pinterface
2) snmpinterface

String query = "select snmpinterface.ipaddr, snmpinterface.snmpifdescr, snmpinterface.snmpifspeed, snmpinterface.snmpifindex, snmpinterface.snmpifname, snmpinterface.snmpphysaddr from ipinterface, snmpinterface where ipinterface.ismanaged='M' and snmpinterface.nodeid = ipinterface.nodeid and snmpinterface.snmpifindex = ipinterface.ifindex and snmpinterface.nodeid = '" +routerName +"'";

1) devices
2) categories

String query = "select deviceID, advnet_deviceName, CI_ID, CustomerId from devices , categories where devices.isActive = 1 and categories.categoryName='Router' and devices.subCategory = categories.id and domain_manager_id = "+domainManagerID;


Thanks in advance for any help you can give to me.I am waiting your reply..

Thanks
Jay
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic