posted 19 years ago
Hi,
I think this query will work for you,
Query q1 = session.createQuery(SELECT eh FROM com.domain.ErrorHist as eh, com.domain.DeviceReadings as dr WHERE eh.deviceReadings.deviceReadingKey=dr.deviceReadingKey AND dr.modelNumber=:mn AND dr.brandName=:bn AND dr.serialNumber=:sn)
q1.setParameter("mn","sefs",Hibernate.STRING); // second field is the value to be substituted and 3rd is the type of the field
q1.setParameter("bn",new Float(4500000f),Hibernate.FLOAT);// second field is the value to be substituted and 3rd is the type of the field
q1.setParameter("sn",new Integer(2),Hibernate.INTEGER);// second field is the value to be substituted and 3rd is the type of the field
When I put hibernate.show_sql=true in hibernate.properties I could see the queries in console