Register / Login
Object Relational Mapping
Select query with multiple where clause
posted 4 years ago
I have two tables with device and transaction
Device Id of device is the foreign key of transaction
how write hql query Device Id not used in second table
My current hql query for device is
String fromClause = "select device from Device device where "+searchCritiria1+" like"+"'%"+searchString1+"%' and "+searchCritiria2+" like"+"'%"+searchString2'"; Query query = getSession().createQuery(fromClause);
here searchCritiria1,searchCritiria2 column name and searchString1,searchString2 are parameters passed from UI
how i added these sql query to
where Device ID not in (select deviceID from transaction)
Boost this thread!
Deleting Record in a Web Application.
HQL help needed
Help with HQL Insert and Joins using Hibernate 3 / JPA
Stored Procedure inside HQL query?
HQL query for multiple conditions met