Skip to content

Commit 398f91c

Browse files
committed
Polishing
1 parent b4115f3 commit 398f91c

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBean.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@
4343
* Hibernate SessionFactory in a Spring application context; the SessionFactory can
4444
* then be passed to Hibernate-based data access objects via dependency injection.
4545
*
46-
* <p><b>NOTE:</b> This variant of LocalSessionFactoryBean requires Hibernate 4.0 or higher.
47-
* It is similar in role to the same-named class in the {@code orm.hibernate3} package.
48-
* However, in practice, it is closer to {@code AnnotationSessionFactoryBean} since
49-
* its core purpose is to bootstrap a {@code SessionFactory} from annotation scanning.
46+
* <p><b>This variant of LocalSessionFactoryBean requires Hibernate 4.0 or higher.</b>
47+
* Note that this version is not compatible with the (the quite refactored) Hibernate
48+
* 4.3 yet; please upgrade to the Spring 4.0 line for full Hibernate 4.3 support.
49+
* We recommend using this version with the latest Hibernate 4.1.x or 4.2.x releases.
50+
*
51+
* <p>This class is similar in role to the same-named class in the {@code orm.hibernate3}
52+
* package. However, in practice, it is closer to {@code AnnotationSessionFactoryBean}
53+
* since its core purpose is to bootstrap a {@code SessionFactory} from package scanning.
5054
*
5155
* <p><b>NOTE:</b> To set up Hibernate 4 for Spring-driven JTA transactions, make
5256
* sure to either specify the {@link #setJtaTransactionManager "jtaTransactionManager"}

spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/LocalSessionFactoryBuilder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,6 +54,11 @@
5454
* <p>This is designed for programmatic use, e.g. in {@code @Bean} factory methods.
5555
* Consider using {@link LocalSessionFactoryBean} for XML bean definition files.
5656
*
57+
* <p><b>Requires Hibernate 4.0 or higher.</b> Note that this version is not
58+
* compatible with the (the quite refactored) Hibernate 4.3 yet; please upgrade
59+
* to the Spring 4.0 line for full Hibernate 4.3 support. We recommend using
60+
* this version with the latest Hibernate 4.1.x or 4.2.x releases.
61+
*
5762
* <p><b>NOTE:</b> To set up Hibernate 4 for Spring-driven JTA transactions, make
5863
* sure to either use the {@link #setJtaTransactionManager} method or to set the
5964
* "hibernate.transaction.factory_class" property to {@link CMTTransactionFactory}.

spring-orm/src/main/java/org/springframework/orm/hibernate3/HibernateTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ public List findByNamedQueryAndNamedParam(
10011001
final String queryName, final String[] paramNames, final Object[] values)
10021002
throws DataAccessException {
10031003

1004-
if (paramNames != null && values != null && paramNames.length != values.length) {
1004+
if (values != null && (paramNames == null || paramNames.length != values.length)) {
10051005
throw new IllegalArgumentException("Length of paramNames array must match length of values array");
10061006
}
10071007
return executeWithNativeSession(new HibernateCallback<List>() {

spring-orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void setResourceLoader(ResourceLoader resourceLoader) {
165165
protected void postProcessMappings(Configuration config) throws HibernateException {
166166
AnnotationConfiguration annConfig = (AnnotationConfiguration) config;
167167
if (this.annotatedClasses != null) {
168-
for (Class annotatedClass : this.annotatedClasses) {
168+
for (Class<?> annotatedClass : this.annotatedClasses) {
169169
annConfig.addAnnotatedClass(annotatedClass);
170170
}
171171
}

0 commit comments

Comments
 (0)