Hello,
1. Please make the message "no appropriate constructor in class" of the PropertyNotFoundException inside getConstructor(Class clazz, Type[] types) in class org.hibernate.util.ReflectHelper more expressive. I have found many other posts affected to dynamic instantiation and the correct constructor. I propose you list the expected types in the message like this:
Code:
StringBuilder msg = new StringBuilder();
msg.append("no appropriate constructor in class: ")
.append(clazz.getName())
.append("\nexpected parameter types: [");
boolean comma = false;
for (Type type : types) {
if (comma) msg.append(", ");
if (type != null)
msg.append(type.getReturnedClass().getName());
else
msg.append("null");
comma = true;
}
msg.append("]");
throw new PropertyNotFoundException(msg.toString());
2. The dynamic instantiation runs into a NullPointerException if the underlying sql statement returns null for a column. I guess this is a bug. I'm using JBoss AS 5.1/Hibernate Core 3.3.1.
Cheers Dieter.