-->
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: Dealing with Oracle Char datatype in Detached Criteria expr
PostPosted: Thu Nov 27, 2008 7:08 am 
Newbie

Joined: Wed Oct 22, 2008 10:20 pm
Posts: 11
Hi,

I am writing a subquery that look like this:
select * from SUPPLIER where trim(suppProdId) IN (SELECT ProdId FROM PRODUCT)

The 'suppProdId' in SUPPLIER table is of char(20) data type.
The 'ProdId' in PRODUCT table is of varchar(40) data type

So in order to retrieve the records, I will need to do a trim to the 'suppProdId'.


Below is part of my code using detached criteria expression:

q = session.createCriteria(Supplier.class);

DetachedCriteria p = DetachedCriteria.forClass(Product.class)
.setProjection(Property.forName("ProdId"));

q.add(Property.forName("suppProdId").in(p));

However, there is no records retrieved when I used the detached criteria expression.
Is there a way where I can trim the data of the 'suppProdId'?

Thanks in advance.


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.