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
JPA
MapUserEntity
implementation. 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:
-
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
ConstructorDescriptionNo-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
Modifier and TypeMethodDescriptionvoid
addCredential
(MapUserCredentialEntity credentialEntity) void
addFederatedIdentity
(MapUserFederatedIdentityEntity federatedIdentity) void
addGroupsMembership
(String groupId) void
addRequiredAction
(String requiredAction) void
addRolesMembership
(String roleId) void
addUserConsent
(MapUserConsentEntity userConsentEntity) boolean
getAttribute
(String name) getCredential
(String id) getEmail()
getFederatedIdentity
(String identityProviderId) getId()
getUserConsent
(String clientId) int
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
void
removeAttribute
(String name) removeCredential
(MapUserCredentialEntity credentialEntity) removeFederatedIdentity
(String identityProviderId) removeFederatedIdentity
(MapUserFederatedIdentityEntity federatedIdentity) void
removeGroupsMembership
(String groupId) void
removeRequiredAction
(String requiredAction) void
removeRolesMembership
(String roleId) removeUserConsent
(String clientId) removeUserConsent
(MapUserConsentEntity userConsentEntity) void
setAttribute
(String name, List<String> values) void
setAttributes
(Map<String, List<String>> attributes) void
setCreatedTimestamp
(Long createdTimestamp) void
setCredentials
(List<MapUserCredentialEntity> credentials) void
void
setEmailConstraint
(String emailConstraint) void
setEmailVerified
(Boolean emailVerified) void
setEnabled
(Boolean enabled) void
setEntityVersion
(Integer entityVersion) void
setFederatedIdentities
(Set<MapUserFederatedIdentityEntity> federatedIdentities) void
setFederationLink
(String federationLink) void
setFirstName
(String firstName) void
setGroupsMembership
(Set<String> groupsMembership) void
void
setLastName
(String lastName) void
setNotBefore
(Long notBefore) void
setRealmId
(String realmId) void
setRequiredActions
(Set<String> requiredActions) void
setRolesMembership
(Set<String> rolesMembership) void
setServiceAccountClientLink
(String serviceAccountClientLink) void
setUserConsents
(Set<MapUserConsentEntity> userConsents) void
setUsername
(String username) Methods inherited from class org.keycloak.models.map.user.MapUserEntity.AbstractUserEntity
clearUpdatedFlag, isUpdated, moveCredential, setEmail
Methods inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
markUpdatedFlag
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
Methods inherited from interface org.keycloak.models.map.common.UpdatableEntity
markUpdatedFlag
-
Constructor Details
-
JpaUserEntity
public JpaUserEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaUserEntity
-
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 Details
-
isMetadataInitialized
public boolean isMetadataInitialized() -
getEntityVersion
- Specified by:
getEntityVersion
in interfaceJpaRootEntity
- Returns:
- current supported version of the JPA entity used for schema versioning.
-
setEntityVersion
- Specified by:
setEntityVersion
in interfaceJpaRootEntity
- Parameters:
entityVersion
- sets current supported version to JPA entity.
-
getCurrentSchemaVersion
- Specified by:
getCurrentSchemaVersion
in interfaceJpaRootEntity
-
getVersion
public int getVersion()Description copied from interface:JpaRootVersionedEntity
Version of the JPA entity used for optimistic locking- Specified by:
getVersion
in interfaceJpaRootVersionedEntity
-
getId
- Specified by:
getId
in interfaceAbstractEntity
- Overrides:
getId
in classMapUserEntity.AbstractUserEntity
-
setId
- Specified by:
setId
in interfaceAbstractEntity
- Overrides:
setId
in classMapUserEntity.AbstractUserEntity
-
getRealmId
- Specified by:
getRealmId
in interfaceMapUserEntity
-
setRealmId
- Specified by:
setRealmId
in interfaceMapUserEntity
-
getUsername
- Specified by:
getUsername
in interfaceMapUserEntity
- Returns:
- User's username with respecting letter case.
-
setUsername
- Specified by:
setUsername
in interfaceMapUserEntity
-
getFirstName
- Specified by:
getFirstName
in interfaceMapUserEntity
-
setFirstName
- Specified by:
setFirstName
in interfaceMapUserEntity
-
getCreatedTimestamp
- Specified by:
getCreatedTimestamp
in interfaceMapUserEntity
-
setCreatedTimestamp
- Specified by:
setCreatedTimestamp
in interfaceMapUserEntity
-
getLastName
- Specified by:
getLastName
in interfaceMapUserEntity
-
setLastName
- Specified by:
setLastName
in interfaceMapUserEntity
-
getEmail
- Specified by:
getEmail
in interfaceMapUserEntity
-
setEmail
- Specified by:
setEmail
in interfaceMapUserEntity
-
isEnabled
- Specified by:
isEnabled
in interfaceMapUserEntity
-
setEnabled
- Specified by:
setEnabled
in interfaceMapUserEntity
-
isEmailVerified
- Specified by:
isEmailVerified
in interfaceMapUserEntity
-
setEmailVerified
- Specified by:
setEmailVerified
in interfaceMapUserEntity
-
getEmailConstraint
- Specified by:
getEmailConstraint
in interfaceMapUserEntity
-
setEmailConstraint
- Specified by:
setEmailConstraint
in interfaceMapUserEntity
-
getFederationLink
- Specified by:
getFederationLink
in interfaceMapUserEntity
-
setFederationLink
- Specified by:
setFederationLink
in interfaceMapUserEntity
-
getServiceAccountClientLink
- Specified by:
getServiceAccountClientLink
in interfaceMapUserEntity
-
setServiceAccountClientLink
- Specified by:
setServiceAccountClientLink
in interfaceMapUserEntity
-
getNotBefore
- Specified by:
getNotBefore
in interfaceMapUserEntity
-
setNotBefore
- Specified by:
setNotBefore
in interfaceMapUserEntity
-
getGroupsMembership
- Specified by:
getGroupsMembership
in interfaceMapUserEntity
-
setGroupsMembership
- Specified by:
setGroupsMembership
in interfaceMapUserEntity
-
addGroupsMembership
- Specified by:
addGroupsMembership
in interfaceMapUserEntity
-
removeGroupsMembership
- Specified by:
removeGroupsMembership
in interfaceMapUserEntity
-
getRolesMembership
- Specified by:
getRolesMembership
in interfaceMapUserEntity
-
setRolesMembership
- Specified by:
setRolesMembership
in interfaceMapUserEntity
-
addRolesMembership
- Specified by:
addRolesMembership
in interfaceMapUserEntity
-
removeRolesMembership
- Specified by:
removeRolesMembership
in interfaceMapUserEntity
-
getRequiredActions
- Specified by:
getRequiredActions
in interfaceMapUserEntity
-
setRequiredActions
- Specified by:
setRequiredActions
in interfaceMapUserEntity
-
addRequiredAction
- Specified by:
addRequiredAction
in interfaceMapUserEntity
-
removeRequiredAction
- Specified by:
removeRequiredAction
in interfaceMapUserEntity
-
getAttributes
- Specified by:
getAttributes
in interfaceEntityWithAttributes
-
setAttributes
- Specified by:
setAttributes
in interfaceEntityWithAttributes
-
getAttribute
- Specified by:
getAttribute
in interfaceEntityWithAttributes
-
setAttribute
- Specified by:
setAttribute
in interfaceEntityWithAttributes
-
removeAttribute
- Specified by:
removeAttribute
in interfaceEntityWithAttributes
-
getUserConsents
- Specified by:
getUserConsents
in interfaceMapUserEntity
-
getUserConsent
- Specified by:
getUserConsent
in interfaceMapUserEntity
-
setUserConsents
- Specified by:
setUserConsents
in interfaceMapUserEntity
-
addUserConsent
- Specified by:
addUserConsent
in interfaceMapUserEntity
-
removeUserConsent
- Specified by:
removeUserConsent
in interfaceMapUserEntity
-
removeUserConsent
- Specified by:
removeUserConsent
in interfaceMapUserEntity
-
getCredentials
- Specified by:
getCredentials
in interfaceMapUserEntity
-
getCredential
- Specified by:
getCredential
in interfaceMapUserEntity
-
setCredentials
- Specified by:
setCredentials
in interfaceMapUserEntity
-
addCredential
- Specified by:
addCredential
in interfaceMapUserEntity
-
removeCredential
- Specified by:
removeCredential
in interfaceMapUserEntity
-
removeCredential
- Specified by:
removeCredential
in interfaceMapUserEntity
-
getFederatedIdentities
- Specified by:
getFederatedIdentities
in interfaceMapUserEntity
-
getFederatedIdentity
- Specified by:
getFederatedIdentity
in interfaceMapUserEntity
-
setFederatedIdentities
- Specified by:
setFederatedIdentities
in interfaceMapUserEntity
-
addFederatedIdentity
- Specified by:
addFederatedIdentity
in interfaceMapUserEntity
-
removeFederatedIdentity
- Specified by:
removeFederatedIdentity
in interfaceMapUserEntity
-
removeFederatedIdentity
- Specified by:
removeFederatedIdentity
in interfaceMapUserEntity
-
hashCode
public int hashCode() -
equals
-