updated repository to use proper concrete class

pull/306/merge
Justin Richer 2013-03-21 15:20:36 -04:00
parent 8fccbf3483
commit 08eaaa0a12
2 changed files with 4 additions and 11 deletions

View File

@ -1,13 +1,5 @@
package org.mitre.openid.connect.model;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
import javax.persistence.Table;
public interface UserInfo {

View File

@ -54,14 +54,15 @@ public class JpaUserInfoRepository implements UserInfoRepository {
@Override
@Transactional
public UserInfo save(UserInfo userInfo) {
return saveOrUpdate(userInfo.getSub(), manager, userInfo);
DefaultUserInfo dui = (DefaultUserInfo)userInfo;
return saveOrUpdate(dui.getId(), manager, dui);
}
@Override
@Transactional
public void remove(UserInfo userInfo) {
UserInfo found = manager.find(DefaultUserInfo.class, userInfo.getSub());
DefaultUserInfo dui = (DefaultUserInfo)userInfo;
UserInfo found = manager.find(DefaultUserInfo.class, dui.getId());
if (found != null) {
manager.remove(userInfo);