Merge pull request #2191 from patriot1burke/master
hashcode/equals on all entities/adapters
This commit is contained in:
commit
02b9d5ee13
48 changed files with 602 additions and 189 deletions
|
@ -404,4 +404,21 @@ public class UserAdapter implements UserModel {
|
|||
return updated.revokeConsentForClient(clientId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || !(o instanceof UserModel)) return false;
|
||||
|
||||
UserModel that = (UserModel) o;
|
||||
return that.getId().equals(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getId().hashCode();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -142,4 +142,23 @@ public class AuthenticationExecutionEntity {
|
|||
public void setAuthenticatorConfig(String authenticatorConfig) {
|
||||
this.authenticatorConfig = authenticatorConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof AuthenticationExecutionEntity)) return false;
|
||||
|
||||
AuthenticationExecutionEntity that = (AuthenticationExecutionEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -131,4 +131,23 @@ public class AuthenticationFlowEntity {
|
|||
public void setBuiltIn(boolean builtIn) {
|
||||
this.builtIn = builtIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof AuthenticationFlowEntity)) return false;
|
||||
|
||||
AuthenticationFlowEntity that = (AuthenticationFlowEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -86,4 +86,23 @@ public class AuthenticatorConfigEntity {
|
|||
public void setConfig(Map<String, String> config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof AuthenticatorConfigEntity)) return false;
|
||||
|
||||
AuthenticatorConfigEntity that = (AuthenticatorConfigEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -454,4 +454,23 @@ public class ClientEntity {
|
|||
public void setUseTemplateMappers(boolean useTemplateMappers) {
|
||||
this.useTemplateMappers = useTemplateMappers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof ClientEntity)) return false;
|
||||
|
||||
ClientEntity that = (ClientEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,8 @@ public class ClientIdentityProviderMappingEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof ClientIdentityProviderMappingEntity)) return false;
|
||||
|
||||
ClientIdentityProviderMappingEntity key = (ClientIdentityProviderMappingEntity) o;
|
||||
|
||||
|
@ -135,4 +136,6 @@ public class ClientIdentityProviderMappingEntity {
|
|||
result = 31 * result + (identityProvider != null ? identityProvider.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -221,4 +221,23 @@ public class ClientTemplateEntity {
|
|||
public void setBearerOnly(boolean bearerOnly) {
|
||||
this.bearerOnly = bearerOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof ClientTemplateEntity)) return false;
|
||||
|
||||
ClientTemplateEntity that = (ClientTemplateEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -167,4 +167,23 @@ public class CredentialEntity {
|
|||
public void setPeriod(int period) {
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof CredentialEntity)) return false;
|
||||
|
||||
CredentialEntity that = (CredentialEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -157,4 +157,27 @@ public class FederatedIdentityEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof FederatedIdentityEntity)) return false;
|
||||
|
||||
FederatedIdentityEntity key = (FederatedIdentityEntity) o;
|
||||
|
||||
if (identityProvider != null ? !identityProvider.equals(key.identityProvider) : key.identityProvider != null)
|
||||
return false;
|
||||
if (user != null ? !user.getId().equals(key.user != null ? key.user.getId() : null) : key.user != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = user != null ? user.getId().hashCode() : 0;
|
||||
result = 31 * result + (identityProvider != null ? identityProvider.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -84,4 +84,23 @@ public class GroupAttributeEntity {
|
|||
public void setGroup(GroupEntity group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof GroupAttributeEntity)) return false;
|
||||
|
||||
GroupAttributeEntity that = (GroupAttributeEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -107,6 +107,7 @@ public class GroupEntity {
|
|||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof GroupEntity)) return false;
|
||||
|
||||
GroupEntity that = (GroupEntity) o;
|
||||
|
||||
|
|
|
@ -114,4 +114,26 @@ public class GroupRoleMappingEntity {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof GroupRoleMappingEntity)) return false;
|
||||
|
||||
GroupRoleMappingEntity key = (GroupRoleMappingEntity) o;
|
||||
|
||||
if (!roleId.equals(key.roleId)) return false;
|
||||
if (!group.equals(key.group)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = group.hashCode();
|
||||
result = 31 * result + roleId.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -178,4 +178,23 @@ public class IdentityProviderEntity {
|
|||
public void setTrustEmail(boolean trustEmail) {
|
||||
this.trustEmail = trustEmail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof IdentityProviderEntity)) return false;
|
||||
|
||||
IdentityProviderEntity that = (IdentityProviderEntity) o;
|
||||
|
||||
if (!internalId.equals(that.internalId)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return internalId.hashCode();
|
||||
}
|
||||
|
||||
}
|
|
@ -110,7 +110,8 @@ public class IdentityProviderMapperEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof IdentityProviderMapperEntity)) return false;
|
||||
|
||||
IdentityProviderMapperEntity that = (IdentityProviderMapperEntity) o;
|
||||
|
||||
|
|
|
@ -57,4 +57,23 @@ public class MigrationModelEntity {
|
|||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof MigrationModelEntity)) return false;
|
||||
|
||||
MigrationModelEntity that = (MigrationModelEntity) o;
|
||||
|
||||
if (!id.equals(that.id)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -142,7 +142,8 @@ public class ProtocolMapperEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof ProtocolMapperEntity)) return false;
|
||||
|
||||
ProtocolMapperEntity that = (ProtocolMapperEntity) o;
|
||||
|
||||
|
|
|
@ -119,4 +119,26 @@ public class RealmAttributeEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof RealmAttributeEntity)) return false;
|
||||
|
||||
RealmAttributeEntity key = (RealmAttributeEntity) o;
|
||||
|
||||
if (name != null ? !name.equals(key.name) : key.name != null) return false;
|
||||
if (realm != null ? !realm.getId().equals(key.realm != null ? key.realm.getId() : null) : key.realm != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = realm != null ? realm.getId().hashCode() : 0;
|
||||
result = 31 * result + (name != null ? name.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -769,5 +769,24 @@ public class RealmEntity {
|
|||
public void setClientTemplates(Collection<ClientTemplateEntity> clientTemplates) {
|
||||
this.clientTemplates = clientTemplates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof RealmEntity)) return false;
|
||||
|
||||
RealmEntity that = (RealmEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -132,4 +132,23 @@ public class RequiredActionProviderEntity {
|
|||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof RequiredActionProviderEntity)) return false;
|
||||
|
||||
RequiredActionProviderEntity that = (RequiredActionProviderEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -134,4 +134,26 @@ public class RequiredCredentialEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof RequiredCredentialEntity)) return false;
|
||||
|
||||
RequiredCredentialEntity key = (RequiredCredentialEntity) o;
|
||||
|
||||
if (realm != null ? !realm.getId().equals(key.realm != null ? key.realm.getId() : null) : key.realm != null) return false;
|
||||
if (type != null ? !type.equals(key.type) : key.type != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = realm != null ? realm.getId().hashCode() : 0;
|
||||
result = 31 * result + (type != null ? type.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -167,6 +167,7 @@ public class RoleEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof RoleEntity)) return false;
|
||||
|
||||
RoleEntity that = (RoleEntity) o;
|
||||
|
|
|
@ -113,4 +113,26 @@ public class ScopeMappingEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof ScopeMappingEntity)) return false;
|
||||
|
||||
ScopeMappingEntity key = (ScopeMappingEntity) o;
|
||||
|
||||
if (client != null ? !client.getId().equals(key.client != null ? key.client.getId() : null) : key.client != null) return false;
|
||||
if (role != null ? !role.getId().equals(key.role != null ? key.role.getId() : null) : key.role != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = client != null ? client.getId().hashCode() : 0;
|
||||
result = 31 * result + (role != null ? role.getId().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -113,4 +113,26 @@ public class TemplateScopeMappingEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!(o instanceof TemplateScopeMappingEntity)) return false;
|
||||
|
||||
TemplateScopeMappingEntity key = (TemplateScopeMappingEntity) o;
|
||||
|
||||
if (template != null ? !template.getId().equals(key.template != null ? key.template.getId() : null) : key.template != null) return false;
|
||||
if (role != null ? !role.getId().equals(key.role != null ? key.role.getId() : null) : key.role != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = template != null ? template.getId().hashCode() : 0;
|
||||
result = 31 * result + (role != null ? role.getId().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -91,4 +91,23 @@ public class UserAttributeEntity {
|
|||
this.user = user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserAttributeEntity)) return false;
|
||||
|
||||
UserAttributeEntity that = (UserAttributeEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
19
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentEntity.java
Normal file → Executable file
19
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentEntity.java
Normal file → Executable file
|
@ -105,4 +105,23 @@ public class UserConsentEntity {
|
|||
public void setGrantedProtocolMappers(Collection<UserConsentProtocolMapperEntity> grantedProtocolMappers) {
|
||||
this.grantedProtocolMappers = grantedProtocolMappers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserConsentEntity)) return false;
|
||||
|
||||
UserConsentEntity that = (UserConsentEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
5
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentProtocolMapperEntity.java
Normal file → Executable file
5
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentProtocolMapperEntity.java
Normal file → Executable file
|
@ -73,7 +73,8 @@ public class UserConsentProtocolMapperEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserConsentProtocolMapperEntity)) return false;
|
||||
|
||||
UserConsentProtocolMapperEntity that = (UserConsentProtocolMapperEntity)o;
|
||||
Key myKey = new Key(this.userConsent, this.protocolMapperId);
|
||||
|
@ -129,4 +130,6 @@ public class UserConsentProtocolMapperEntity {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
3
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentRoleEntity.java
Normal file → Executable file
3
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserConsentRoleEntity.java
Normal file → Executable file
|
@ -72,7 +72,8 @@ public class UserConsentRoleEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserConsentRoleEntity)) return false;
|
||||
|
||||
UserConsentRoleEntity that = (UserConsentRoleEntity)o;
|
||||
Key myKey = new Key(this.userConsent, this.roleId);
|
||||
|
|
|
@ -232,7 +232,8 @@ public class UserEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserEntity)) return false;
|
||||
|
||||
UserEntity that = (UserEntity) o;
|
||||
|
||||
|
|
3
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserFederationMapperEntity.java
Normal file → Executable file
3
model/jpa/src/main/java/org/keycloak/models/jpa/entities/UserFederationMapperEntity.java
Normal file → Executable file
|
@ -114,7 +114,8 @@ public class UserFederationMapperEntity {
|
|||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (o == null ) return false;
|
||||
if (!(o instanceof UserFederationMapperEntity)) return false;
|
||||
|
||||
UserFederationMapperEntity that = (UserFederationMapperEntity) o;
|
||||
|
||||
|
|
|
@ -137,4 +137,23 @@ public class UserFederationProviderEntity {
|
|||
public void setLastSync(int lastSync) {
|
||||
this.lastSync = lastSync;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserFederationProviderEntity)) return false;
|
||||
|
||||
UserFederationProviderEntity that = (UserFederationProviderEntity) o;
|
||||
|
||||
if (!id.equals(that.getId())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -116,4 +116,26 @@ public class UserGroupMembershipEntity {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserGroupMembershipEntity)) return false;
|
||||
|
||||
UserGroupMembershipEntity key = (UserGroupMembershipEntity) o;
|
||||
|
||||
if (!groupId.equals(key.groupId)) return false;
|
||||
if (!user.equals(key.user)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = user.hashCode();
|
||||
result = 31 * result + groupId.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -110,4 +110,26 @@ public class UserRequiredActionEntity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserRequiredActionEntity)) return false;
|
||||
|
||||
UserRequiredActionEntity key = (UserRequiredActionEntity) o;
|
||||
|
||||
if (action != key.action) return false;
|
||||
if (user != null ? !user.getId().equals(key.user != null ? key.user.getId() : null) : key.user != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = user != null ? user.getId().hashCode() : 0;
|
||||
result = 31 * result + (action != null ? action.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -117,4 +117,26 @@ public class UserRoleMappingEntity {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
if (!(o instanceof UserRoleMappingEntity)) return false;
|
||||
|
||||
UserRoleMappingEntity key = (UserRoleMappingEntity) o;
|
||||
|
||||
if (!roleId.equals(key.roleId)) return false;
|
||||
if (!user.equals(key.user)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = user.hashCode();
|
||||
result = 31 * result + roleId.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
2
server-spi/src/main/java/org/keycloak/models/entities/AbstractIdentifiableEntity.java
Normal file → Executable file
2
server-spi/src/main/java/org/keycloak/models/entities/AbstractIdentifiableEntity.java
Normal file → Executable file
|
@ -24,7 +24,7 @@ package org.keycloak.models.entities;
|
|||
*/
|
||||
public class AbstractIdentifiableEntity {
|
||||
|
||||
private String id;
|
||||
protected String id;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
|
|
@ -24,24 +24,15 @@ import org.keycloak.models.AuthenticationExecutionModel;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class AuthenticationExecutionEntity {
|
||||
protected String id;
|
||||
public class AuthenticationExecutionEntity extends AbstractIdentifiableEntity {
|
||||
protected String authenticator;
|
||||
private String authenticatorConfig;
|
||||
protected String authenticatorConfig;
|
||||
protected String flowId;
|
||||
protected AuthenticationExecutionModel.Requirement requirement;
|
||||
protected int priority;
|
||||
private boolean userSetupAllowed;
|
||||
private boolean authenticatorFlow;
|
||||
private String parentFlow;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
protected boolean userSetupAllowed;
|
||||
protected boolean authenticatorFlow;
|
||||
protected String parentFlow;
|
||||
|
||||
public String getAuthenticator() {
|
||||
return authenticator;
|
||||
|
|
|
@ -24,23 +24,14 @@ import java.util.List;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class AuthenticationFlowEntity {
|
||||
protected String id;
|
||||
public class AuthenticationFlowEntity extends AbstractIdentifiableEntity {
|
||||
protected String alias;
|
||||
protected String description;
|
||||
protected String providerId;
|
||||
private boolean topLevel;
|
||||
private boolean builtIn;
|
||||
protected boolean topLevel;
|
||||
protected boolean builtIn;
|
||||
|
||||
List<AuthenticationExecutionEntity> executions = new ArrayList<AuthenticationExecutionEntity>();
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
|
|
|
@ -23,18 +23,9 @@ import java.util.Map;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class AuthenticatorConfigEntity {
|
||||
protected String id;
|
||||
public class AuthenticatorConfigEntity extends AbstractIdentifiableEntity{
|
||||
protected String alias;
|
||||
private Map<String, String> config;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
protected Map<String, String> config;
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
|
|
|
@ -27,48 +27,48 @@ import java.util.Map;
|
|||
*/
|
||||
public class ClientEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
private String clientId;
|
||||
private String name;
|
||||
private String description;
|
||||
private String realmId;
|
||||
private boolean enabled;
|
||||
private String clientAuthenticatorType;
|
||||
private String secret;
|
||||
private String registrationToken;
|
||||
private String protocol;
|
||||
private int notBefore;
|
||||
private boolean publicClient;
|
||||
private boolean fullScopeAllowed;
|
||||
private boolean frontchannelLogout;
|
||||
protected String clientId;
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected String realmId;
|
||||
protected boolean enabled;
|
||||
protected String clientAuthenticatorType;
|
||||
protected String secret;
|
||||
protected String registrationToken;
|
||||
protected String protocol;
|
||||
protected int notBefore;
|
||||
protected boolean publicClient;
|
||||
protected boolean fullScopeAllowed;
|
||||
protected boolean frontchannelLogout;
|
||||
|
||||
private boolean surrogateAuthRequired;
|
||||
private String managementUrl;
|
||||
private String rootUrl;
|
||||
private String baseUrl;
|
||||
private boolean bearerOnly;
|
||||
private boolean consentRequired;
|
||||
private boolean standardFlowEnabled;
|
||||
private boolean implicitFlowEnabled;
|
||||
private boolean directAccessGrantsEnabled;
|
||||
private boolean serviceAccountsEnabled;
|
||||
private int nodeReRegistrationTimeout;
|
||||
protected boolean surrogateAuthRequired;
|
||||
protected String managementUrl;
|
||||
protected String rootUrl;
|
||||
protected String baseUrl;
|
||||
protected boolean bearerOnly;
|
||||
protected boolean consentRequired;
|
||||
protected boolean standardFlowEnabled;
|
||||
protected boolean implicitFlowEnabled;
|
||||
protected boolean directAccessGrantsEnabled;
|
||||
protected boolean serviceAccountsEnabled;
|
||||
protected int nodeReRegistrationTimeout;
|
||||
|
||||
// We are using names of defaultRoles (not ids)
|
||||
private List<String> defaultRoles = new ArrayList<String>();
|
||||
protected List<String> defaultRoles = new ArrayList<String>();
|
||||
|
||||
private Map<String, Integer> registeredNodes;
|
||||
protected Map<String, Integer> registeredNodes;
|
||||
|
||||
private Map<String, String> attributes = new HashMap<String, String>();
|
||||
protected Map<String, String> attributes = new HashMap<String, String>();
|
||||
|
||||
private List<String> webOrigins = new ArrayList<String>();
|
||||
private List<String> redirectUris = new ArrayList<String>();
|
||||
private List<String> scopeIds = new ArrayList<String>();
|
||||
private List<ClientIdentityProviderMappingEntity> identityProviders = new ArrayList<ClientIdentityProviderMappingEntity>();
|
||||
private List<ProtocolMapperEntity> protocolMappers = new ArrayList<ProtocolMapperEntity>();
|
||||
private String clientTemplate;
|
||||
private boolean useTemplateConfig;
|
||||
private boolean useTemplateScope;
|
||||
private boolean useTemplateMappers;
|
||||
protected List<String> webOrigins = new ArrayList<String>();
|
||||
protected List<String> redirectUris = new ArrayList<String>();
|
||||
protected List<String> scopeIds = new ArrayList<String>();
|
||||
protected List<ClientIdentityProviderMappingEntity> identityProviders = new ArrayList<ClientIdentityProviderMappingEntity>();
|
||||
protected List<ProtocolMapperEntity> protocolMappers = new ArrayList<ProtocolMapperEntity>();
|
||||
protected String clientTemplate;
|
||||
protected boolean useTemplateConfig;
|
||||
protected boolean useTemplateScope;
|
||||
protected boolean useTemplateMappers;
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
|
|
|
@ -19,18 +19,9 @@ package org.keycloak.models.entities;
|
|||
/**
|
||||
* @author pedroigor
|
||||
*/
|
||||
public class ClientIdentityProviderMappingEntity {
|
||||
public class ClientIdentityProviderMappingEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
private String id;
|
||||
private boolean retrieveToken;
|
||||
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
protected boolean retrieveToken;
|
||||
|
||||
public boolean isRetrieveToken() {
|
||||
return this.retrieveToken;
|
||||
|
|
|
@ -27,22 +27,22 @@ import java.util.Map;
|
|||
*/
|
||||
public class ClientTemplateEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private String realmId;
|
||||
private String protocol;
|
||||
private boolean fullScopeAllowed;
|
||||
private boolean bearerOnly;
|
||||
private boolean consentRequired;
|
||||
private boolean standardFlowEnabled;
|
||||
private boolean implicitFlowEnabled;
|
||||
private boolean directAccessGrantsEnabled;
|
||||
private boolean serviceAccountsEnabled;
|
||||
private boolean publicClient;
|
||||
private boolean frontchannelLogout;
|
||||
private List<String> scopeIds = new ArrayList<>();
|
||||
private List<ProtocolMapperEntity> protocolMappers = new ArrayList<>();
|
||||
private Map<String, String> attributes = new HashMap<>();
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected String realmId;
|
||||
protected String protocol;
|
||||
protected boolean fullScopeAllowed;
|
||||
protected boolean bearerOnly;
|
||||
protected boolean consentRequired;
|
||||
protected boolean standardFlowEnabled;
|
||||
protected boolean implicitFlowEnabled;
|
||||
protected boolean directAccessGrantsEnabled;
|
||||
protected boolean serviceAccountsEnabled;
|
||||
protected boolean publicClient;
|
||||
protected boolean frontchannelLogout;
|
||||
protected List<String> scopeIds = new ArrayList<>();
|
||||
protected List<ProtocolMapperEntity> protocolMappers = new ArrayList<>();
|
||||
protected Map<String, String> attributes = new HashMap<>();
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
|
@ -20,30 +20,21 @@ package org.keycloak.models.entities;
|
|||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class CredentialEntity {
|
||||
public class CredentialEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
private String id;
|
||||
private String type;
|
||||
private String value;
|
||||
private String device;
|
||||
private byte[] salt;
|
||||
private int hashIterations;
|
||||
private Long createdDate;
|
||||
private UserEntity user;
|
||||
private int counter;
|
||||
private String algorithm;
|
||||
private int digits;
|
||||
private int period;
|
||||
protected String type;
|
||||
protected String value;
|
||||
protected String device;
|
||||
protected byte[] salt;
|
||||
protected int hashIterations;
|
||||
protected Long createdDate;
|
||||
protected UserEntity user;
|
||||
protected int counter;
|
||||
protected String algorithm;
|
||||
protected int digits;
|
||||
protected int period;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -133,4 +133,21 @@ public class IdentityProviderEntity {
|
|||
public void setTrustEmail(boolean trustEmail) {
|
||||
this.trustEmail = trustEmail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof IdentityProviderEntity)) return false;
|
||||
|
||||
IdentityProviderEntity that = (IdentityProviderEntity) o;
|
||||
|
||||
if (!internalId.equals(that.internalId)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return internalId.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,21 +23,12 @@ import java.util.Map;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class IdentityProviderMapperEntity {
|
||||
protected String id;
|
||||
public class IdentityProviderMapperEntity extends AbstractIdentifiableEntity {
|
||||
protected String name;
|
||||
protected String identityProviderAlias;
|
||||
protected String identityProviderMapper;
|
||||
protected Map<String, String> config;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
11
server-spi/src/main/java/org/keycloak/models/entities/PersistentUserSessionEntity.java
Normal file → Executable file
11
server-spi/src/main/java/org/keycloak/models/entities/PersistentUserSessionEntity.java
Normal file → Executable file
|
@ -22,23 +22,14 @@ import java.util.List;
|
|||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class PersistentUserSessionEntity {
|
||||
public class PersistentUserSessionEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
private String id;
|
||||
private String realmId;
|
||||
private String userId;
|
||||
private int lastSessionRefresh;
|
||||
private String data;
|
||||
private List<PersistentClientSessionEntity> clientSessions;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRealmId() {
|
||||
return realmId;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.Map;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class ProtocolMapperEntity {
|
||||
protected String id;
|
||||
public class ProtocolMapperEntity extends AbstractIdentifiableEntity {
|
||||
protected String name;
|
||||
protected String protocol;
|
||||
protected String protocolMapper;
|
||||
|
@ -32,14 +31,6 @@ public class ProtocolMapperEntity {
|
|||
protected String consentText;
|
||||
protected Map<String, String> config;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.Map;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class RequiredActionProviderEntity {
|
||||
protected String id;
|
||||
public class RequiredActionProviderEntity extends AbstractIdentifiableEntity {
|
||||
protected String alias;
|
||||
protected String name;
|
||||
protected String providerId;
|
||||
|
@ -32,14 +31,6 @@ public class RequiredActionProviderEntity {
|
|||
protected boolean defaultAction;
|
||||
private Map<String, String> config;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
|
|
11
server-spi/src/main/java/org/keycloak/models/entities/UserFederationMapperEntity.java
Normal file → Executable file
11
server-spi/src/main/java/org/keycloak/models/entities/UserFederationMapperEntity.java
Normal file → Executable file
|
@ -22,22 +22,13 @@ import java.util.Map;
|
|||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
*/
|
||||
public class UserFederationMapperEntity {
|
||||
public class UserFederationMapperEntity extends AbstractIdentifiableEntity {
|
||||
|
||||
protected String id;
|
||||
protected String name;
|
||||
protected String federationProviderId;
|
||||
protected String federationMapperType;
|
||||
protected Map<String, String> config;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.Map;
|
|||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public class UserFederationProviderEntity {
|
||||
protected String id;
|
||||
public class UserFederationProviderEntity extends AbstractIdentifiableEntity {
|
||||
protected String providerName;
|
||||
protected Map<String, String> config;
|
||||
protected int priority;
|
||||
|
@ -34,14 +33,6 @@ public class UserFederationProviderEntity {
|
|||
private int lastSync;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProviderName() {
|
||||
return providerName;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue