Hi Joel
Thanks for quick response. The search screen in my case has fields related to more than one database views.
For example
The Device Search screen in my case has following fields
- hostName & ipAddress related to DeviceSummaryView pojo
- deviceContact related to DeviceContactView pojo
- hostContact & ipAddress related to HostNameContactView pojo
As user may search on any of these fields , i wanna use Criteria query as something like this
Code:
Criteria criteria = session.createCriteria(DeviceSummaryView.class)
.createCriteria(DeviceContactView.class)
.createCriteria(HostNameContactView.class);
so that it result into following query
Code:
select hostName,ipAddress,
deviceContact,
hostContact
[b]from
DeviceSummaryView deviceSummaryView,
DeviceContactView deviceContactView,
HostNameContactView hostNameView[/b]
where
hostName=?
[b]AND
ipAddress=?
AND
deviceContactView.deviceId = deviceSummaryView.deviceId
AND
hostNameView.deviceId = deviceSummaryView.deviceId[/b]
Currently i am able to successfully search on the fields related to single pojo i.e. ipAddress & hostName using session.createCriteria(DeviceSummaryView.class)
Any pointers/suggestions on how to extend this to search on additional fields i.e. deviceContact & hostNameContact related to other pojos will be highly appreciated
Regards
Bansi