Hi All
I'm new in this Hibernate world. As usual, I'm facing a problem.
In my query example, I've a table with composite id. This table is mapped to one class having inner class. this inner class is mapped with composite id.
To use QBE, i create an instance with some id. and then i pass this instance to use as an example.
while debugging it shows the value in instance but on console it doesn't show the given criteria. I don't why it's skipping given criteria.
Please help me in this.
Following is a part from actual code.
I'm sure it's showing value in debug mode.
the code where I'm creating example and criterion.
@SuppressWarnings("unchecked")
public static List<ExnetMtdShipments> list(Criteria criteria) throws HibernateException {
return criteria.list();
}
public List<ExnetMtdShipments> getBuyingHistoryReportData(ExnetMtdShipments example) throws AppException{
List<ExnetMtdShipments> list ;
Session session = HibernateUtil.getSession(Constants.DATASOURCE);
Criterion cr = Example.create(example).enableLike();
try {
list = ReportDaoImpl.list(session.createCriteria(ExnetMtdShipments.class).add(cr));
}catch( Exception exception ) {
}
return list;
}
The query I'm getting in console:
select
this_.CURRENCY as CURRENCY4_0_,
this_.CUST_NUM as CUST2_4_0_,
this_.FISCAL_MONTH as FISCAL3_4_0_,
this_.FISCAL_YEAR as FISCAL4_4_0_,
this_.ITEM_NUM as ITEM5_4_0_,
this_.PART_NUM as PART6_4_0_,
this_.STD_SEUOM as STD7_4_0_,
this_.SHIPPED_QTY as SHIPPED8_4_0_,
this_.EXTENDED_PRICE as EXTENDED9_4_0_
from
DCS06.EXNET_MTD_SHIPMENTS this_
where
(
1=1
)
|