Skip to content
Snippets Groups Projects
Verified Commit de38f313 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

DOC: update CHANGELOG

parent 989b53e6
No related branches found
No related tags found
1 merge request!107BUG: replacement ids interfering with external ids
Pipeline #42690 passed
...@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `FIND ENTITY <ID> is broken`. * `FIND ENTITY <ID> is broken`.
[linkahead-server#323](https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/323) [linkahead-server#323](https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/323)
* Unknown Server Error when inserting an Entity.
[linkahead-mariadbbackend](https://gitlab.indiscale.com/caosdb/src/caosdb-mysqlbackend/-/issues/48)
### Security ### Security
......
...@@ -107,20 +107,15 @@ public class DatabaseUtils { ...@@ -107,20 +107,15 @@ public class DatabaseUtils {
final List<Property> stage1Inserts, final List<Property> stage1Inserts,
Deque<EntityID> replacementIds, Deque<EntityID> replacementIds,
EntityInterface entity) { EntityInterface entity) {
Map<String, EntityInterface> replacements = new HashMap<>();
for (final Property p : stage1Inserts) { for (final Property p : stage1Inserts) {
if (p instanceof Replacement) { if (p instanceof Replacement) {
if (!p.hasId() || p.getId().isTemporary()) { if (!p.hasId() || p.getId().isTemporary()) {
EntityID replacementId = replacementIds.pop(); EntityID replacementId = replacementIds.pop();
replacements.put(replacementId.toString(), p);
((Replacement) p).setReplacementId(replacementId); ((Replacement) p).setReplacementId(replacementId);
} }
} }
}
for (final Property p : stage1Inserts) {
if (p.hasProperties()) { if (p.hasProperties()) {
if (p instanceof Replacement && ((Replacement) p).isState2Replacement()) { if (p instanceof Replacement && ((Replacement) p).isStage2Replacement()) {
stage2Inserts.add(((Replacement) p).replacement); stage2Inserts.add(((Replacement) p).replacement);
} }
for (Property subP : p.getProperties()) { for (Property subP : p.getProperties()) {
...@@ -148,7 +143,6 @@ public class DatabaseUtils { ...@@ -148,7 +143,6 @@ public class DatabaseUtils {
subP.setDomain(p); subP.setDomain(p);
if (subP.hasProperties()) { if (subP.hasProperties()) {
Replacement r = new Replacement(subP); Replacement r = new Replacement(subP);
r.replacement.setDomain(p);
r.setStage2Replacement(true); r.setStage2Replacement(true);
stage1Inserts.add(r); stage1Inserts.add(r);
processSubPropertiesStage1(stage1Inserts, r); processSubPropertiesStage1(stage1Inserts, r);
......
...@@ -41,7 +41,7 @@ enum ReplacementStatus implements StatementStatusInterface { ...@@ -41,7 +41,7 @@ enum ReplacementStatus implements StatementStatusInterface {
public class Replacement extends Property { public class Replacement extends Property {
public Property replacement; public Property replacement;
private boolean state2Replacement; private boolean stage2Replacement;
@Override @Override
public EntityID getId() { public EntityID getId() {
...@@ -61,7 +61,7 @@ public class Replacement extends Property { ...@@ -61,7 +61,7 @@ public class Replacement extends Property {
super(p); super(p);
replacement = new Property(new RetrieveEntity()); replacement = new Property(new RetrieveEntity());
replacement.setDomain(p); replacement.setDomain(p.getDomainEntity());
replacement.setId(new EntityID()); replacement.setId(new EntityID());
replacement.setStatementStatus(ReplacementStatus.REPLACEMENT); replacement.setStatementStatus(ReplacementStatus.REPLACEMENT);
replacement.setValue(new ReferenceValue(p.getId())); replacement.setValue(new ReferenceValue(p.getId()));
...@@ -69,10 +69,10 @@ public class Replacement extends Property { ...@@ -69,10 +69,10 @@ public class Replacement extends Property {
} }
public void setStage2Replacement(boolean t) { public void setStage2Replacement(boolean t) {
this.state2Replacement = t; this.stage2Replacement = t;
} }
public boolean isState2Replacement() { public boolean isStage2Replacement() {
return state2Replacement; return stage2Replacement;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment