-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Need Help in Query By Example
PostPosted: Tue Jul 10, 2007 10:53 am 
Newbie

Joined: Tue Jul 10, 2007 10:30 am
Posts: 2
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
)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.