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

WIP: String IDs

parent 83682a68
No related branches found
No related tags found
2 merge requests!105Release 0.11.0,!78External IDs
Pipeline #41932 canceled
......@@ -654,7 +654,7 @@ public abstract class Entity extends AbstractObservable implements EntityInterfa
// Parse ID. Generate error if it isn't an integer.
if (element.getAttribute("id") != null && !element.getAttributeValue("id").equals("")) {
this.getId().setId(element.getAttributeValue("id"));
this.setId(element.getAttributeValue("id"));
}
// Parse NAME.
......
......@@ -194,4 +194,8 @@ public interface EntityInterface
public abstract boolean isReferenceList();
public abstract SerializeFieldStrategy getSerializeFieldStrategy();
public default void setId(String id) {
getId().setId(id);
}
}
......@@ -71,6 +71,8 @@ public class LazyEntityResolver extends EntityWrapper {
public void resolveAll() {
resolveParents();
resolveProperties();
// release the transaction for the garbage collector
this.transaction = null;
}
@Override
......
......@@ -44,7 +44,7 @@ public class GenerateEntityId extends EntityJob {
&& getTransaction() instanceof WriteTransactionInterface
&& entity.getEntityStatus() == EntityStatus.QUALIFIED) {
String id = ((WriteTransactionInterface) getTransaction()).generateId();
entity.getId().setId(id);
entity.setId(id);
}
}
}
......@@ -258,7 +258,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
public boolean isInternal() {
try {
return Integer.parseInt(id) < 101;
return Integer.parseInt(id) < 100;
} catch (NumberFormatException e) {
return false;
}
......
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