Skip to content
Snippets Groups Projects
Commit 22d6f232 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

qs

parent bdb2d0a3
No related tags found
No related merge requests found
Pipeline #25237 passed
......@@ -101,11 +101,12 @@ public class DatabaseUtils {
processSubPropertiesStage1(stage1Inserts, p);
}
/* returns the count of domains in the stage1Inserts */
public static int deriveStage2Inserts(
final List<EntityInterface> stage2Inserts, final List<EntityInterface> stage1Inserts) {
int domainCount = 0;
for (final EntityInterface p : stage1Inserts) {
if (p.hasRole() && p.getRole() == Role.Domain) {
if (p.hasRole() && p.getRole() == Role.Domain) { // should no role be allowed? Fail fast?
domainCount++;
}
if (!p.hasReplacement() && p.hasProperties()) {
......
......@@ -56,7 +56,11 @@ public class InsertEntityProperties extends BackendTransaction {
final ArrayList<EntityInterface> stage1Inserts = new ArrayList<EntityInterface>();
final ArrayList<EntityInterface> stage2Inserts = new ArrayList<EntityInterface>();
/*
* The insertion is split into two stages in order to allow (among other stuff) subproperties.
* In some cases a replacement is needed, then the original property will be in the stage1Inserts
* list and the replacement will be in stage2Inserts.
*/
DatabaseUtils.deriveStage1Inserts(stage1Inserts, this.entity);
final int domainCount = DatabaseUtils.deriveStage2Inserts(stage2Inserts, stage1Inserts);
......@@ -67,8 +71,8 @@ public class InsertEntityProperties extends BackendTransaction {
insertStages(t, domainIds, stage2Inserts, this.entity.getId(), null);
}
private void insertStages(
final InsertEntityPropertiesImpl t,
private void insertStages( // seems to insert a single stage only; bad naming?
final InsertEntityPropertiesImpl t, // TODO bad var name
final Deque<Integer> domainIds,
final List<EntityInterface> stage1Inserts,
final Integer domain,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment