Session.delete -> deleteById

Fixes gh-809
This commit is contained in:
Rob Winch
2017-06-22 21:24:20 -05:00
parent 0127ef9f9b
commit c6c6beb40c
14 changed files with 25 additions and 25 deletions

View File

@@ -109,7 +109,7 @@ public abstract class AbstractJdbcOperationsSessionRepositoryITests {
assertThat(session.<String>getAttribute(expectedAttributeName))
.isEqualTo(toSave.getAttribute(expectedAttributeName));
this.repository.delete(toSave.getId());
this.repository.deleteById(toSave.getId());
assertThat(this.repository.findById(toSave.getId())).isNull();
}
@@ -142,7 +142,7 @@ public abstract class AbstractJdbcOperationsSessionRepositoryITests {
assertThat(session.<String>getAttribute("a")).isEqualTo(Optional.of("b"));
assertThat(session.<String>getAttribute("1")).isEqualTo(Optional.of("2"));
this.repository.delete(toSave.getId());
this.repository.deleteById(toSave.getId());
}
@Test
@@ -180,7 +180,7 @@ public abstract class AbstractJdbcOperationsSessionRepositoryITests {
assertThat(findByPrincipalName).hasSize(1);
assertThat(findByPrincipalName.keySet()).containsOnly(toSave.getId());
this.repository.delete(toSave.getId());
this.repository.deleteById(toSave.getId());
findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME,
principalName);
@@ -354,7 +354,7 @@ public abstract class AbstractJdbcOperationsSessionRepositoryITests {
assertThat(findByPrincipalName).hasSize(1);
assertThat(findByPrincipalName.keySet()).containsOnly(toSave.getId());
this.repository.delete(toSave.getId());
this.repository.deleteById(toSave.getId());
findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME,
getSecurityName());

View File

@@ -476,7 +476,7 @@ public class JdbcOperationsSessionRepository implements
if (session != null) {
if (session.isExpired()) {
delete(id);
deleteById(id);
}
else {
return new JdbcSession(session);
@@ -485,7 +485,7 @@ public class JdbcOperationsSessionRepository implements
return null;
}
public void delete(final String id) {
public void deleteById(final String id) {
this.transactionOperations.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus status) {

View File

@@ -455,7 +455,7 @@ public class JdbcOperationsSessionRepositoryTests {
public void delete() {
String sessionId = "testSessionId";
this.repository.delete(sessionId);
this.repository.deleteById(sessionId);
assertPropagationRequiresNew();
verify(this.jdbcOperations, times(1)).update(startsWith("DELETE"), eq(sessionId));