Polishing

This commit is contained in:
Juergen Hoeller
2014-01-27 22:49:14 +01:00
parent b4115f3202
commit 398f91cb74
4 changed files with 16 additions and 7 deletions

View File

@@ -1001,7 +1001,7 @@ public class HibernateTemplate extends HibernateAccessor implements HibernateOpe
final String queryName, final String[] paramNames, final Object[] values)
throws DataAccessException {
if (paramNames != null && values != null && paramNames.length != values.length) {
if (values != null && (paramNames == null || paramNames.length != values.length)) {
throw new IllegalArgumentException("Length of paramNames array must match length of values array");
}
return executeWithNativeSession(new HibernateCallback<List>() {

View File

@@ -165,7 +165,7 @@ public class AnnotationSessionFactoryBean extends LocalSessionFactoryBean implem
protected void postProcessMappings(Configuration config) throws HibernateException {
AnnotationConfiguration annConfig = (AnnotationConfiguration) config;
if (this.annotatedClasses != null) {
for (Class annotatedClass : this.annotatedClasses) {
for (Class<?> annotatedClass : this.annotatedClasses) {
annConfig.addAnnotatedClass(annotatedClass);
}
}