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
This commit is part of merge request !107. Comments created here will be created in the context of that merge request.
......@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `FIND ENTITY <ID> is broken`.
[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
......
......@@ -107,20 +107,15 @@ public class DatabaseUtils {
final List<Property> stage1Inserts,
Deque<EntityID> replacementIds,
EntityInterface entity) {
Map<String, EntityInterface> replacements = new HashMap<>();
for (final Property p : stage1Inserts) {
if (p instanceof Replacement) {
if (!p.hasId() || p.getId().isTemporary()) {
EntityID replacementId = replacementIds.pop();
replacements.put(replacementId.toString(), p);
((Replacement) p).setReplacementId(replacementId);
}
}
}
for (final Property p : stage1Inserts) {
if (p.hasProperties()) {
if (p instanceof Replacement && ((Replacement) p).isState2Replacement()) {
if (p instanceof Replacement && ((Replacement) p).isStage2Replacement()) {
stage2Inserts.add(((Replacement) p).replacement);
}
for (Property subP : p.getProperties()) {
......@@ -148,7 +143,6 @@ public class DatabaseUtils {
subP.setDomain(p);
if (subP.hasProperties()) {
Replacement r = new Replacement(subP);
r.replacement.setDomain(p);
r.setStage2Replacement(true);
stage1Inserts.add(r);
processSubPropertiesStage1(stage1Inserts, r);
......
......@@ -41,7 +41,7 @@ enum ReplacementStatus implements StatementStatusInterface {
public class Replacement extends Property {
public Property replacement;
private boolean state2Replacement;
private boolean stage2Replacement;
@Override
public EntityID getId() {
......@@ -61,7 +61,7 @@ public class Replacement extends Property {
super(p);
replacement = new Property(new RetrieveEntity());
replacement.setDomain(p);
replacement.setDomain(p.getDomainEntity());
replacement.setId(new EntityID());
replacement.setStatementStatus(ReplacementStatus.REPLACEMENT);
replacement.setValue(new ReferenceValue(p.getId()));
......@@ -69,10 +69,10 @@ public class Replacement extends Property {
}
public void setStage2Replacement(boolean t) {
this.state2Replacement = t;
this.stage2Replacement = t;
}
public boolean isState2Replacement() {
return state2Replacement;
public boolean isStage2Replacement() {
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