Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister
In directory sc8-pr-cvs1:/tmp/cvs-serv3374/hibernate/persister
Modified Files:
AbstractEntityPersister.java
Log Message:
re-reworked import functionality
Index: AbstractEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** AbstractEntityPersister.java 29 Mar 2003 04:08:48 -0000 1.15
--- AbstractEntityPersister.java 29 Mar 2003 07:36:22 -0000 1.16
***************
*** 321,337 ****
else {
if (abstractClass) throw new HibernateException("Cannot instantiate abstract class or interface: " + className);
! try {
! if (optimizer != null) {
! try {
! return optimizer.newInstance();
! }
! catch (Throwable t) {
! throw new InstantiationException("Could not instantiate entity with CGLIB: ", mappedClass, t);
! }
}
- return constructor.newInstance(null);
}
! catch (Exception e) {
! throw new InstantiationException("Could not instantiate entity: ", mappedClass, e);
}
}
--- 321,339 ----
else {
if (abstractClass) throw new HibernateException("Cannot instantiate abstract class or interface: " + className);
! if (optimizer != null) {
! try {
! return optimizer.newInstance();
! }
! catch (Throwable t) {
! throw new InstantiationException("Could not instantiate entity with CGLIB: ", mappedClass, t);
}
}
! else {
! try {
! return constructor.newInstance(null);
! }
! catch (Exception e) {
! throw new InstantiationException("Could not instantiate entity: ", mappedClass, e);
! }
}
}
***************
*** 674,688 ****
}
! MetaClass opt;
! try {
! opt = MetaClass.getInstance( mappedClass.getClassLoader(), mappedClass, getterNames, setterNames, types );
! opt.setPropertyValues( opt.newInstance(), opt.getPropertyValues( opt.newInstance() ) );
! //throw new NullPointerException();
! }
! catch(Throwable t) {
! opt=null;
! log.info("reflection optimizer disabled for: " + mappedClass);
! }
! optimizer=opt;
hasCascades = foundCascade;
--- 676,680 ----
}
! optimizer=ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types);
hasCascades = foundCascade;
|