Hi Gavin,
This is the Exception get generated will retrive the object :-
SEVERE: IllegalArgumentException in class: com.ge.med.registries.acc_30.hibernat
e.TA3PatientT, getter method of property: participant
Dec 4, 2003 5:06:01 PM org.apache.commons.logging.impl.Jdk14Logger error
SEVERE: Exception initializing proxy
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.hibernate.util.ReflectHelper$Getter.get(ReflectHelper.java:94)
at net.sf.hibernate.type.ComponentType.getPropertyValue(ComponentType.ja
va:188)
at net.sf.hibernate.type.ComponentType.getPropertyValues(ComponentType.j
ava:208)
at net.sf.hibernate.type.ComponentType.nullSafeGetValues(ComponentType.j
ava:173)
at net.sf.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:16
0)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:486)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:136)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:573)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:
392)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901)
at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710
)
at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.jav
a:48)
at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyI
nitializer.java:55)
at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitiali
zer.java:153)
at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitia
lizer.java:49)
at com.ge.med.registries.acc_30.hibernate.TA3PatientT$$EnhancedByCGLIB$$
1.toString(<generated>)
at java.lang.String.valueOf(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at Retrive.main(Retrive.java:61)
rethrown as net.sf.hibernate.PropertyAccessException: IllegalArgumentException o
ccurred calling: object is not an instance of declaring class getter of com.ge.m
ed.registries.acc_30.hibernate.TA3PatientT.participant
The code is like this
Query q = sess.createQuery(
"from TCx1PatientT as patient " +
"where patient.primary =:primary"
);
System.out.println(q.toString());
q.setInteger("primary",primary);
List list = q.list();
if(list.size()>0)
{
patient = (TCx1PatientT) list.get(0);
}
tx.commit();
System.out.println("*********************"+patient);
System.out.println("*********************"+(TCx1PtsiteT) patient.getSite().get(0));
site = (TCx1PtsiteT) patient.getSite().get(0);
System.out.println("*********************"+site.getPatient());
System.out.println("*********************"+site.getParticipant());
//Booms here
System.out.println("*********************"+site.getAccPatient());
TA3Patient contain get and set property of particpant , then what can be reason of generation Getter property Exception.
For more information let me know
Devesh
|