remove some @JoinTables
This commit is contained in:
parent
f2bd50335a
commit
8bf9ea838a
4 changed files with 23 additions and 15 deletions
|
@ -42,7 +42,7 @@ public class LockingConnectionProviderFactory extends DefaultInfinispanConnectio
|
||||||
protected void initEmbedded() {
|
protected void initEmbedded() {
|
||||||
super.initEmbedded();
|
super.initEmbedded();
|
||||||
ConfigurationBuilder counterConfigBuilder = new ConfigurationBuilder();
|
ConfigurationBuilder counterConfigBuilder = new ConfigurationBuilder();
|
||||||
counterConfigBuilder//.invocationBatching().enable()
|
counterConfigBuilder.invocationBatching().enable()
|
||||||
.transaction().transactionMode(TransactionMode.TRANSACTIONAL);
|
.transaction().transactionMode(TransactionMode.TRANSACTIONAL);
|
||||||
counterConfigBuilder.transaction().transactionManagerLookup(new DummyTransactionManagerLookup());
|
counterConfigBuilder.transaction().transactionManagerLookup(new DummyTransactionManagerLookup());
|
||||||
counterConfigBuilder.transaction().lockingMode(LockingMode.PESSIMISTIC);
|
counterConfigBuilder.transaction().lockingMode(LockingMode.PESSIMISTIC);
|
||||||
|
|
|
@ -755,7 +755,7 @@ public class RealmAdapter implements RealmModel {
|
||||||
entity.setEnabled(true);
|
entity.setEnabled(true);
|
||||||
entity.setStandardFlowEnabled(true);
|
entity.setStandardFlowEnabled(true);
|
||||||
entity.setRealm(realm);
|
entity.setRealm(realm);
|
||||||
//realm.getClients().add(entity);
|
realm.getClients().add(entity);
|
||||||
em.persist(entity);
|
em.persist(entity);
|
||||||
em.flush();
|
em.flush();
|
||||||
final ClientModel resource = new ClientAdapter(this, em, session, entity);
|
final ClientModel resource = new ClientAdapter(this, em, session, entity);
|
||||||
|
@ -781,7 +781,6 @@ public class RealmAdapter implements RealmModel {
|
||||||
client.removeRole(role);
|
client.removeRole(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
ClientEntity clientEntity = null;
|
ClientEntity clientEntity = null;
|
||||||
Iterator<ClientEntity> it = realm.getClients().iterator();
|
Iterator<ClientEntity> it = realm.getClients().iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
|
@ -797,8 +796,6 @@ public class RealmAdapter implements RealmModel {
|
||||||
clientEntity = a;
|
clientEntity = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
ClientEntity clientEntity = em.find(ClientEntity.class, id);
|
|
||||||
if (clientEntity == null) return false;
|
if (clientEntity == null) return false;
|
||||||
em.createNamedQuery("deleteScopeMappingByClient").setParameter("client", clientEntity).executeUpdate();
|
em.createNamedQuery("deleteScopeMappingByClient").setParameter("client", clientEntity).executeUpdate();
|
||||||
em.remove(clientEntity);
|
em.remove(clientEntity);
|
||||||
|
@ -1020,6 +1017,7 @@ public class RealmAdapter implements RealmModel {
|
||||||
entity.setFullSyncPeriod(model.getFullSyncPeriod());
|
entity.setFullSyncPeriod(model.getFullSyncPeriod());
|
||||||
entity.setChangedSyncPeriod(model.getChangedSyncPeriod());
|
entity.setChangedSyncPeriod(model.getChangedSyncPeriod());
|
||||||
entity.setLastSync(model.getLastSync());
|
entity.setLastSync(model.getLastSync());
|
||||||
|
entity.setRealm(realm);
|
||||||
em.persist(entity);
|
em.persist(entity);
|
||||||
realm.getUserFederationProviders().add(entity);
|
realm.getUserFederationProviders().add(entity);
|
||||||
|
|
||||||
|
|
|
@ -141,20 +141,16 @@ public class RealmEntity {
|
||||||
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
||||||
Collection<RequiredCredentialEntity> requiredCredentials = new ArrayList<RequiredCredentialEntity>();
|
Collection<RequiredCredentialEntity> requiredCredentials = new ArrayList<RequiredCredentialEntity>();
|
||||||
|
|
||||||
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true)
|
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
||||||
@JoinTable(name="FED_PROVIDERS", joinColumns={ @JoinColumn(name="REALM_ID") }, inverseJoinColumns={ @JoinColumn(name = "USERFEDERATIONPROVIDERS_ID") })
|
|
||||||
List<UserFederationProviderEntity> userFederationProviders = new ArrayList<UserFederationProviderEntity>();
|
List<UserFederationProviderEntity> userFederationProviders = new ArrayList<UserFederationProviderEntity>();
|
||||||
|
|
||||||
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
||||||
Collection<UserFederationMapperEntity> userFederationMappers = new ArrayList<UserFederationMapperEntity>();
|
Collection<UserFederationMapperEntity> userFederationMappers = new ArrayList<UserFederationMapperEntity>();
|
||||||
|
|
||||||
//@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy="realm")
|
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy="realm")
|
||||||
//@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true)
|
Collection<ClientEntity> clients = new ArrayList<>();
|
||||||
//@JoinTable(name="REALM_CLIENT", joinColumns={ @JoinColumn(name="REALM_ID") }, inverseJoinColumns={ @JoinColumn(name="CLIENT_ID") })
|
|
||||||
//Collection<ClientEntity> clients = new ArrayList<>();
|
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true)
|
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, orphanRemoval = true, mappedBy = "realm")
|
||||||
@JoinTable(name="REALM_CLIENT_TEMPLATE", joinColumns={ @JoinColumn(name="REALM_ID") }, inverseJoinColumns={ @JoinColumn(name="CLIENT_TEMPLATE_ID") })
|
|
||||||
Collection<ClientTemplateEntity> clientTemplates = new ArrayList<>();
|
Collection<ClientTemplateEntity> clientTemplates = new ArrayList<>();
|
||||||
|
|
||||||
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, mappedBy = "realm")
|
@OneToMany(fetch = FetchType.LAZY, cascade ={CascadeType.REMOVE}, mappedBy = "realm")
|
||||||
|
@ -425,7 +421,6 @@ public class RealmEntity {
|
||||||
public void setRequiredCredentials(Collection<RequiredCredentialEntity> requiredCredentials) {
|
public void setRequiredCredentials(Collection<RequiredCredentialEntity> requiredCredentials) {
|
||||||
this.requiredCredentials = requiredCredentials;
|
this.requiredCredentials = requiredCredentials;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
public Collection<ClientEntity> getClients() {
|
public Collection<ClientEntity> getClients() {
|
||||||
return clients;
|
return clients;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +428,6 @@ public class RealmEntity {
|
||||||
public void setClients(Collection<ClientEntity> clients) {
|
public void setClients(Collection<ClientEntity> clients) {
|
||||||
this.clients = clients;
|
this.clients = clients;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
public Collection<RoleEntity> getRoles() {
|
public Collection<RoleEntity> getRoles() {
|
||||||
return roles;
|
return roles;
|
||||||
|
|
16
model/jpa/src/main/resources/META-INF/jpa-changelog-1.9.0.xml
Normal file → Executable file
16
model/jpa/src/main/resources/META-INF/jpa-changelog-1.9.0.xml
Normal file → Executable file
|
@ -60,5 +60,21 @@
|
||||||
<where>ACCESS_TOKEN_LIFE_IMPLICIT is NULL</where>
|
<where>ACCESS_TOKEN_LIFE_IMPLICIT is NULL</where>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<dropUniqueConstraint tableName="REALM_CLIENT" constraintName="UK_M6QGA3RFME47335JY8JXYXH3I" />
|
||||||
|
<dropForeignKeyConstraint baseTableName="REALM_CLIENT" constraintName="FK_93S3P0DIUXAWWQQSA528UBY2Q"/>
|
||||||
|
<dropForeignKeyConstraint baseTableName="REALM_CLIENT" constraintName="FK_M6QGA3RFME47335JY8JXYXH3I"/>
|
||||||
|
<dropTable tableName="REALM_CLIENT" cascadeConstraints="true"/>
|
||||||
|
<dropForeignKeyConstraint baseTableName="REALM_CLIENT_TEMPLATE" constraintName="FK_RLM_CLI_TMPLT_RLM" />
|
||||||
|
<dropForeignKeyConstraint baseTableName="REALM_CLIENT_TEMPLATE" constraintName="FK_RLM_CLI_TMPLT_CLI"/>
|
||||||
|
<dropTable tableName="REALM_CLIENT_TEMPLATE" cascadeConstraints="true"/>
|
||||||
|
|
||||||
|
<dropUniqueConstraint tableName="FED_PROVIDERS" constraintName="UK_DCCIRJLIPU1478VQC89DID88C" />
|
||||||
|
<dropForeignKeyConstraint baseTableName="FED_PROVIDERS" constraintName="FK_213LYQ09FKXQ8K8NY8DY3737T"/>
|
||||||
|
<dropForeignKeyConstraint baseTableName="FED_PROVIDERS" constraintName="FK_DCCIRJLIPU1478VQC89DID88C"/>
|
||||||
|
<dropTable tableName="FED_PROVIDERS" cascadeConstraints="true"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</changeSet>
|
</changeSet>
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
Loading…
Reference in a new issue