Class JpaResourceEntity
java.lang.Object
org.keycloak.models.map.common.UpdatableEntity.Impl
org.keycloak.models.map.authorization.entity.MapResourceEntity.AbstractMapResourceEntity
org.keycloak.models.map.storage.jpa.authorization.resource.entity.JpaResourceEntity
- All Implemented Interfaces:
Serializable
,MapResourceEntity
,AbstractEntity
,EntityWithAttributes
,UpdatableEntity
,JpaRootEntity
,JpaRootVersionedEntity
@Entity
public class JpaResourceEntity
extends MapResourceEntity.AbstractMapResourceEntity
implements JpaRootVersionedEntity
There are some fields marked by
@Column(insertable = false, updatable = false)
.
Those fields are automatically generated by database from json field,
therefore marked as non-insertable and non-updatable to instruct hibernate.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.map.authorization.entity.MapResourceEntity
MapResourceEntity.AbstractMapResourceEntity
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
ConstructorsConstructorDescriptionNo-argument constructor, used by hibernate to instantiate entities.JpaResourceEntity
(UUID id, int version, Integer entityVersion, String realmId, UUID resourceServerId, String name, String type, String owner) Used by hibernate when calling cb.construct from read(QueryParameters) method.JpaResourceEntity
(DeepCloner cloner) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAttribute
(String name) getId()
getName()
getOwner()
getType()
getUris()
int
Version of the JPA entity used for optimistic lockingint
hashCode()
boolean
void
removeAttribute
(String name) void
setAttribute
(String name, List<String> values) void
setAttributes
(Map<String, List<String>> attributes) void
setDisplayName
(String displayName) void
setEntityVersion
(Integer entityVersion) void
setIconUri
(String iconUri) void
void
void
void
setOwnerManagedAccess
(Boolean ownerManagedAccess) void
setRealmId
(String realmId) void
setResourceServerId
(String resourceServerId) void
setScopeIds
(Set<String> scopeIds) void
void
Methods inherited from class org.keycloak.models.map.common.UpdatableEntity.Impl
clearUpdatedFlag, isUpdated, 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.common.UpdatableEntity
clearUpdatedFlag, isUpdated, markUpdatedFlag
-
Constructor Details
-
JpaResourceEntity
public JpaResourceEntity()No-argument constructor, used by hibernate to instantiate entities. -
JpaResourceEntity
-
JpaResourceEntity
public JpaResourceEntity(UUID id, int version, Integer entityVersion, String realmId, UUID resourceServerId, String name, String type, String owner) Used by hibernate when calling cb.construct from read(QueryParameters) method. It is used to select object 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 classMapResourceEntity.AbstractMapResourceEntity
-
setId
- Specified by:
setId
in interfaceAbstractEntity
- Overrides:
setId
in classMapResourceEntity.AbstractMapResourceEntity
-
getRealmId
- Specified by:
getRealmId
in interfaceMapResourceEntity
-
setRealmId
- Specified by:
setRealmId
in interfaceMapResourceEntity
-
getName
- Specified by:
getName
in interfaceMapResourceEntity
-
setName
- Specified by:
setName
in interfaceMapResourceEntity
-
getDisplayName
- Specified by:
getDisplayName
in interfaceMapResourceEntity
-
setDisplayName
- Specified by:
setDisplayName
in interfaceMapResourceEntity
-
getUris
- Specified by:
getUris
in interfaceMapResourceEntity
-
setUris
- Specified by:
setUris
in interfaceMapResourceEntity
-
getType
- Specified by:
getType
in interfaceMapResourceEntity
-
setType
- Specified by:
setType
in interfaceMapResourceEntity
-
getIconUri
- Specified by:
getIconUri
in interfaceMapResourceEntity
-
setIconUri
- Specified by:
setIconUri
in interfaceMapResourceEntity
-
getOwner
- Specified by:
getOwner
in interfaceMapResourceEntity
-
setOwner
- Specified by:
setOwner
in interfaceMapResourceEntity
-
isOwnerManagedAccess
- Specified by:
isOwnerManagedAccess
in interfaceMapResourceEntity
-
setOwnerManagedAccess
- Specified by:
setOwnerManagedAccess
in interfaceMapResourceEntity
-
setResourceServerId
- Specified by:
setResourceServerId
in interfaceMapResourceEntity
-
getResourceServerId
- Specified by:
getResourceServerId
in interfaceMapResourceEntity
-
getScopeIds
- Specified by:
getScopeIds
in interfaceMapResourceEntity
-
setScopeIds
- Specified by:
setScopeIds
in interfaceMapResourceEntity
-
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
-
hashCode
public int hashCode() -
equals
-