-->
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: Hibernate: Problems while fetching data due to spaces
PostPosted: Tue Aug 26, 2008 5:44 am 
Newbie

Joined: Sat Aug 23, 2008 6:56 am
Posts: 1
Hi - I am using Hibernate with Java Web Services and Oracle 10g.

I use a method to fetch data for a key passed. (Method below).
However in many cases, it is possible that the data may not be fetched
as the passed Id resides in the database with spaces. I know if you use HQL you can trim the data. But is there any way in this get method, I can do a get for trimmed data?


public Object getRecord(Object obj) throws XYZException {
Object objectWithVersionNumber = null;

try {
Method method = obj.getClass().getDeclaredMethod("getId", null);
objectWithVersionNumber = session.get(obj.getClass(),
(Serializable) method.invoke(obj, null));

*** Exception Handling **********

return objectWithVersionNumber;

}


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.