Skip to content

Commit f9e7b4c

Browse files
Property: add isVirtual flag.
This will replace the null check on RelationInfo.targetIdProperty to determine if a property is virtual. #537
1 parent 89cc6a5 commit f9e7b4c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

objectbox-java/src/main/java/io/objectbox/Property.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class Property<ENTITY> implements Serializable {
4444

4545
public final String name;
4646
public final boolean isId;
47+
public final boolean isVirtual;
4748
public final String dbName;
4849
public final Class<? extends PropertyConverter> converterClass;
4950

@@ -58,6 +59,10 @@ public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, S
5859
this(entity, ordinal, id, type, name, false, name, null, null);
5960
}
6061

62+
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isVirtual) {
63+
this(entity, ordinal, id, type, name, false, isVirtual, name, null, null);
64+
}
65+
6166
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isId,
6267
@Nullable String dbName) {
6368
this(entity, ordinal, id, type, name, isId, dbName, null, null);
@@ -66,12 +71,19 @@ public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, S
6671
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isId,
6772
@Nullable String dbName, @Nullable Class<? extends PropertyConverter> converterClass,
6873
@Nullable Class customType) {
74+
this(entity, ordinal, id, type, name, isId, false, dbName, converterClass, customType);
75+
}
76+
77+
public Property(EntityInfo<ENTITY> entity, int ordinal, int id, Class<?> type, String name, boolean isId,
78+
boolean isVirtual, @Nullable String dbName,
79+
@Nullable Class<? extends PropertyConverter> converterClass, @Nullable Class customType) {
6980
this.entity = entity;
7081
this.ordinal = ordinal;
7182
this.id = id;
7283
this.type = type;
7384
this.name = name;
7485
this.isId = isId;
86+
this.isVirtual = isVirtual;
7587
this.dbName = dbName;
7688
this.converterClass = converterClass;
7789
this.customType = customType;

0 commit comments

Comments
 (0)