I'm having issues with Criteria queries.
My query call looks like...
DetachedCriteria criteria = DetachedCriteria.forClass(instance.getClass())
.add(Example.create(instance));
List results = getHibernateTemplate().findByCriteria(criteria);
My instance class has these fields...
private Integer issueId;
private Contact supplier;
private IssueComponent issueComponent;
private Product product;
private Contact ownerContact;
private String shortDesc;
private String longDesc;
private String fileName;
private String status;
private String criticality;
private String resolution;
private String resolutionDesc;
private boolean resolutionEmailSend;
I've created an instance of the above instance object and set the criticality field to "Low".
When I pass this object into my query, the generated query includes the resolutionEmailSend field and is scewing my query results.
Here is the generated query.
Hibernate: select this_.issue_id as issue1_0_, this_.supplier_id as supplier2_22_0_, this_.component_id as component3_22_0_, this_.product_id as product4_22_0_, this_.owner_contact_id as owner5_22_0_, this_.short_desc as short6_22_0_, this_.long_desc as long7_22_0_, this_.file_name as file8_22_0_, this_.status as status22_0_, this_.criticality as critica10_22_0_, this_.resolution as resolution22_0_, this_.resolution_desc as resolution12_22_0_, this_.create_ts as create13_22_0_, this_.last_mod_ts as last14_22_0_, this_.create_contact_id as create15_22_0_, this_.last_mod_contact_id as last16_22_0_, this_.version_int as version17_22_0_, this_.resolution_email_ind as resolution18_22_0_ from issue this_ where (this_.criticality=? and this_.resolution_email_ind=?)
How do I keep the boolean types from being included in the generated query?
Thanks in advance.
|