Class JpaUserEntity
- java.lang.Object
-
- org.keycloak.models.map.common.UpdatableEntity.Impl
-
- org.keycloak.models.map.user.MapUserEntity.AbstractUserEntity
-
- org.keycloak.models.map.storage.jpa.user.entity.JpaUserEntity
-
- All Implemented Interfaces:
Serializable,AbstractEntity,EntityWithAttributes,UpdatableEntity,JpaRootEntity,JpaRootVersionedEntity,MapUserEntity
@Entity public class JpaUserEntity extends MapUserEntity.AbstractUserEntity implements JpaRootVersionedEntity
JPAMapUserEntityimplementation. Some fields are annotated with@Column(insertable = false, updatable = false)to indicate that they are automatically generated from json fields. As such, these fields are non-insertable and non-updatable.- Author:
- Stefan Guilhen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.user.MapUserEntity
MapUserEntity.AbstractUserEntity
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.common.UpdatableEntity
UpdatableEntity.Impl
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
updated
-
-
Constructor Summary
Constructors Constructor Description JpaUserEntity()No-argument constructor, used by hibernate to instantiate entities.JpaUserEntity(UUID id, int version, Integer entityVersion, String realmId, String username, String usernameWithCase, String firstName, String lastName, String email, String emailConstraint, String federationLink, Boolean enabled, Boolean emailVerified, Long timestamp)Used by hibernate when calling cb.construct from read(QueryParameters) method.JpaUserEntity(DeepCloner cloner)
-
Method Summary
-
Methods inherited from class org.keycloak.models.map.user.MapUserEntity.AbstractUserEntity
clearUpdatedFlag, isUpdated, moveCredential, setEmail
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.jpa.JpaRootEntity
updateEntityVersion
-
Methods inherited from interface org.keycloak.models.map.user.MapUserEntity
credentialManager
-
-
-
-
Constructor Detail
-
JpaUserEntity
public JpaUserEntity()
No-argument constructor, used by hibernate to instantiate entities.
-
JpaUserEntity
public JpaUserEntity(DeepCloner cloner)
-
JpaUserEntity
public JpaUserEntity(UUID id, int version, Integer entityVersion, String realmId, String username, String usernameWithCase, String firstName, String lastName, String email, String emailConstraint, String federationLink, Boolean enabled, Boolean emailVerified, Long timestamp)
Used by hibernate when calling cb.construct from read(QueryParameters) method. It is used to select user without metadata(json) field.
-
-
Method Detail
-
isMetadataInitialized
public boolean isMetadataInitialized()
-
getEntityVersion
public Integer getEntityVersion()
- Specified by:
getEntityVersionin interfaceJpaRootEntity- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
public void setEntityVersion(Integer entityVersion)
- Specified by:
setEntityVersionin interfaceJpaRootEntity- Parameters:
entityVersion- sets current supported version to JPA entity.
-
getCurrentSchemaVersion
public Integer getCurrentSchemaVersion()
- Specified by:
getCurrentSchemaVersionin interfaceJpaRootEntity
-
getVersion
public int getVersion()
Description copied from interface:JpaRootVersionedEntityVersion of the JPA entity used for optimistic locking- Specified by:
getVersionin interfaceJpaRootVersionedEntity
-
getId
public String getId()
- Specified by:
getIdin interfaceAbstractEntity- Overrides:
getIdin classMapUserEntity.AbstractUserEntity
-
setId
public void setId(String id)
- Specified by:
setIdin interfaceAbstractEntity- Overrides:
setIdin classMapUserEntity.AbstractUserEntity
-
getRealmId
public String getRealmId()
- Specified by:
getRealmIdin interfaceMapUserEntity
-
setRealmId
public void setRealmId(String realmId)
- Specified by:
setRealmIdin interfaceMapUserEntity
-
getUsername
public String getUsername()
- Specified by:
getUsernamein interfaceMapUserEntity- Returns:
- User's username with respecting letter case.
-
setUsername
public void setUsername(String username)
- Specified by:
setUsernamein interfaceMapUserEntity
-
getFirstName
public String getFirstName()
- Specified by:
getFirstNamein interfaceMapUserEntity
-
setFirstName
public void setFirstName(String firstName)
- Specified by:
setFirstNamein interfaceMapUserEntity
-
getCreatedTimestamp
public Long getCreatedTimestamp()
- Specified by:
getCreatedTimestampin interfaceMapUserEntity
-
setCreatedTimestamp
public void setCreatedTimestamp(Long createdTimestamp)
- Specified by:
setCreatedTimestampin interfaceMapUserEntity
-
getLastName
public String getLastName()
- Specified by:
getLastNamein interfaceMapUserEntity
-
setLastName
public void setLastName(String lastName)
- Specified by:
setLastNamein interfaceMapUserEntity
-
getEmail
public String getEmail()
- Specified by:
getEmailin interfaceMapUserEntity
-
setEmail
public void setEmail(String email)
- Specified by:
setEmailin interfaceMapUserEntity
-
isEnabled
public Boolean isEnabled()
- Specified by:
isEnabledin interfaceMapUserEntity
-
setEnabled
public void setEnabled(Boolean enabled)
- Specified by:
setEnabledin interfaceMapUserEntity
-
isEmailVerified
public Boolean isEmailVerified()
- Specified by:
isEmailVerifiedin interfaceMapUserEntity
-
setEmailVerified
public void setEmailVerified(Boolean emailVerified)
- Specified by:
setEmailVerifiedin interfaceMapUserEntity
-
getEmailConstraint
public String getEmailConstraint()
- Specified by:
getEmailConstraintin interfaceMapUserEntity
-
setEmailConstraint
public void setEmailConstraint(String emailConstraint)
- Specified by:
setEmailConstraintin interfaceMapUserEntity
-
getFederationLink
public String getFederationLink()
- Specified by:
getFederationLinkin interfaceMapUserEntity
-
setFederationLink
public void setFederationLink(String federationLink)
- Specified by:
setFederationLinkin interfaceMapUserEntity
-
getServiceAccountClientLink
public String getServiceAccountClientLink()
- Specified by:
getServiceAccountClientLinkin interfaceMapUserEntity
-
setServiceAccountClientLink
public void setServiceAccountClientLink(String serviceAccountClientLink)
- Specified by:
setServiceAccountClientLinkin interfaceMapUserEntity
-
getNotBefore
public Long getNotBefore()
- Specified by:
getNotBeforein interfaceMapUserEntity
-
setNotBefore
public void setNotBefore(Long notBefore)
- Specified by:
setNotBeforein interfaceMapUserEntity
-
getGroupsMembership
public Set<String> getGroupsMembership()
- Specified by:
getGroupsMembershipin interfaceMapUserEntity
-
setGroupsMembership
public void setGroupsMembership(Set<String> groupsMembership)
- Specified by:
setGroupsMembershipin interfaceMapUserEntity
-
addGroupsMembership
public void addGroupsMembership(String groupId)
- Specified by:
addGroupsMembershipin interfaceMapUserEntity
-
removeGroupsMembership
public void removeGroupsMembership(String groupId)
- Specified by:
removeGroupsMembershipin interfaceMapUserEntity
-
getRolesMembership
public Set<String> getRolesMembership()
- Specified by:
getRolesMembershipin interfaceMapUserEntity
-
setRolesMembership
public void setRolesMembership(Set<String> rolesMembership)
- Specified by:
setRolesMembershipin interfaceMapUserEntity
-
addRolesMembership
public void addRolesMembership(String roleId)
- Specified by:
addRolesMembershipin interfaceMapUserEntity
-
removeRolesMembership
public void removeRolesMembership(String roleId)
- Specified by:
removeRolesMembershipin interfaceMapUserEntity
-
getRequiredActions
public Set<String> getRequiredActions()
- Specified by:
getRequiredActionsin interfaceMapUserEntity
-
setRequiredActions
public void setRequiredActions(Set<String> requiredActions)
- Specified by:
setRequiredActionsin interfaceMapUserEntity
-
addRequiredAction
public void addRequiredAction(String requiredAction)
- Specified by:
addRequiredActionin interfaceMapUserEntity
-
removeRequiredAction
public void removeRequiredAction(String requiredAction)
- Specified by:
removeRequiredActionin interfaceMapUserEntity
-
getAttributes
public Map<String,List<String>> getAttributes()
- Specified by:
getAttributesin interfaceEntityWithAttributes
-
setAttributes
public void setAttributes(Map<String,List<String>> attributes)
- Specified by:
setAttributesin interfaceEntityWithAttributes
-
getAttribute
public List<String> getAttribute(String name)
- Specified by:
getAttributein interfaceEntityWithAttributes
-
setAttribute
public void setAttribute(String name, List<String> values)
- Specified by:
setAttributein interfaceEntityWithAttributes
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceEntityWithAttributes
-
getUserConsents
public Set<MapUserConsentEntity> getUserConsents()
- Specified by:
getUserConsentsin interfaceMapUserEntity
-
getUserConsent
public Optional<MapUserConsentEntity> getUserConsent(String clientId)
- Specified by:
getUserConsentin interfaceMapUserEntity
-
setUserConsents
public void setUserConsents(Set<MapUserConsentEntity> userConsents)
- Specified by:
setUserConsentsin interfaceMapUserEntity
-
addUserConsent
public void addUserConsent(MapUserConsentEntity userConsentEntity)
- Specified by:
addUserConsentin interfaceMapUserEntity
-
removeUserConsent
public Boolean removeUserConsent(MapUserConsentEntity userConsentEntity)
- Specified by:
removeUserConsentin interfaceMapUserEntity
-
removeUserConsent
public Boolean removeUserConsent(String clientId)
- Specified by:
removeUserConsentin interfaceMapUserEntity
-
getCredentials
public List<MapUserCredentialEntity> getCredentials()
- Specified by:
getCredentialsin interfaceMapUserEntity
-
getCredential
public Optional<MapUserCredentialEntity> getCredential(String id)
- Specified by:
getCredentialin interfaceMapUserEntity
-
setCredentials
public void setCredentials(List<MapUserCredentialEntity> credentials)
- Specified by:
setCredentialsin interfaceMapUserEntity
-
addCredential
public void addCredential(MapUserCredentialEntity credentialEntity)
- Specified by:
addCredentialin interfaceMapUserEntity
-
removeCredential
public Boolean removeCredential(MapUserCredentialEntity credentialEntity)
- Specified by:
removeCredentialin interfaceMapUserEntity
-
removeCredential
public Boolean removeCredential(String id)
- Specified by:
removeCredentialin interfaceMapUserEntity
-
getFederatedIdentities
public Set<MapUserFederatedIdentityEntity> getFederatedIdentities()
- Specified by:
getFederatedIdentitiesin interfaceMapUserEntity
-
getFederatedIdentity
public Optional<MapUserFederatedIdentityEntity> getFederatedIdentity(String identityProviderId)
- Specified by:
getFederatedIdentityin interfaceMapUserEntity
-
setFederatedIdentities
public void setFederatedIdentities(Set<MapUserFederatedIdentityEntity> federatedIdentities)
- Specified by:
setFederatedIdentitiesin interfaceMapUserEntity
-
addFederatedIdentity
public void addFederatedIdentity(MapUserFederatedIdentityEntity federatedIdentity)
- Specified by:
addFederatedIdentityin interfaceMapUserEntity
-
removeFederatedIdentity
public Boolean removeFederatedIdentity(MapUserFederatedIdentityEntity federatedIdentity)
- Specified by:
removeFederatedIdentityin interfaceMapUserEntity
-
removeFederatedIdentity
public Boolean removeFederatedIdentity(String identityProviderId)
- Specified by:
removeFederatedIdentityin interfaceMapUserEntity
-
-