updated repository to use proper concrete class
parent
8fccbf3483
commit
08eaaa0a12
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue