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;
}
|