force id consistency

pull/210/head
Justin Richer 2012-08-28 15:19:19 -04:00
parent 8876217baf
commit bc0ee4cbab
2 changed files with 6 additions and 0 deletions

View File

@ -83,6 +83,9 @@ public class JpaOAuth2ClientRepository implements OAuth2ClientRepository {
@Override
public ClientDetailsEntity updateClient(Long id, ClientDetailsEntity client) {
// sanity check
client.setId(id);
return JpaUtil.saveOrUpdate(id, manager, client);
}

View File

@ -75,6 +75,9 @@ public class JpaWhitelistedSiteRepository implements WhitelistedSiteRepository {
@Override
@Transactional
public WhitelistedSite update(WhitelistedSite oldWhitelistedSite, WhitelistedSite whitelistedSite) {
// sanity check
whitelistedSite.setId(oldWhitelistedSite.getId());
return saveOrUpdate(oldWhitelistedSite.getId(), manager, whitelistedSite);
}