Skip to content

Commit cc0ea4a

Browse files
committed
Removed deprecated saveOrUpdateAll method from HibernateOperations
1 parent 541f3ed commit cc0ea4a

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -433,19 +433,6 @@ Object load(String entityName, Serializable id, LockMode lockMode)
433433
*/
434434
void saveOrUpdate(String entityName, Object entity) throws DataAccessException;
435435

436-
/**
437-
* Save or update all given persistent instances,
438-
* according to its id (matching the configured "unsaved-value"?).
439-
* Associates the instances with the current Hibernate {@code Session}.
440-
* @param entities the persistent instances to save or update
441-
* (to be associated with the Hibernate {@code Session})
442-
* @throws DataAccessException in case of Hibernate errors
443-
* @deprecated as of Spring 2.5, in favor of individual
444-
* {@code saveOrUpdate} or {@code merge} usage
445-
*/
446-
@Deprecated
447-
void saveOrUpdateAll(Collection entities) throws DataAccessException;
448-
449436
/**
450437
* Persist the state of the given detached instance according to the
451438
* given replication mode, reusing the current identifier value.

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 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.
@@ -753,18 +753,6 @@ public Object doInHibernate(Session session) throws HibernateException {
753753
});
754754
}
755755

756-
public void saveOrUpdateAll(final Collection entities) throws DataAccessException {
757-
executeWithNativeSession(new HibernateCallback<Object>() {
758-
public Object doInHibernate(Session session) throws HibernateException {
759-
checkWriteOperationAllowed(session);
760-
for (Object entity : entities) {
761-
session.saveOrUpdate(entity);
762-
}
763-
return null;
764-
}
765-
});
766-
}
767-
768756
public void replicate(final Object entity, final ReplicationMode replicationMode)
769757
throws DataAccessException {
770758

spring-orm/src/test/java/org/springframework/orm/hibernate3/HibernateTemplateTests.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -815,21 +815,6 @@ public void testSaveOrUpdateWithEntityName() throws HibernateException {
815815
verify(session).close();
816816
}
817817

818-
@Test
819-
public void testSaveOrUpdateAll() throws HibernateException {
820-
TestBean tb1 = new TestBean();
821-
TestBean tb2 = new TestBean();
822-
given(session.getFlushMode()).willReturn(FlushMode.AUTO);
823-
List tbs = new ArrayList();
824-
tbs.add(tb1);
825-
tbs.add(tb2);
826-
hibernateTemplate.saveOrUpdateAll(tbs);
827-
verify(session).saveOrUpdate(same(tb1));
828-
verify(session).saveOrUpdate(same(tb2));
829-
verify(session).flush();
830-
verify(session).close();
831-
}
832-
833818
@Test
834819
public void testReplicate() throws HibernateException {
835820
TestBean tb = new TestBean();

0 commit comments

Comments
 (0)