DATACMNS-34 - Fixed exception message to include class name and point to argument constructors, not no-arg ones.

This commit is contained in:
Oliver Gierke
2011-05-13 10:02:58 +02:00
parent 727bf4cc99
commit 138191fd19

View File

@@ -79,7 +79,9 @@ public class PreferredConstructorDiscoverer<T> {
if (!noArgConstructorFound && numberOfArgConstructors > 1) {
throw new IllegalArgumentException(
"Multiple no-arg constructors found! Annotate one with @PreferedConstructor explicitly to select it to be used in persistence operations.");
String.format("Multiple constructors with arguments found in class %s! Annotate " +
"one with @PreferedConstructor explicitly to select it to be used in " +
"persistence operations.", rawOwningType.getName()));
}
}