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

I want to join three tables using DetachedCriteria  RSS feed

Mansi Mishra
Ranch Hand
Posts: 51
  • 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

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

Thanks in advance
Amit Ghorpade
Posts: 2856
Fedora Firefox Browser Java
  • 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
Posts: 5
  • 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 = and domain_manager_id = "+domainManagerID;

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

    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!