I am trying to get every EngineKingdom instance with the rootLocation.x smaller than 1000
I have tried
return Engine.getInstance().getDatabaseManager().datastore.find(EngineKingdom.class).filter(
Filters.and(
Filters.lte("rootLocation.x", location.x - 1024)
)
).first();
@Entity(value = "kingdoms")
@NoArgsConstructor
@Setter
@Getter
public class EngineKingdom extends PKingdom {
public @Id ObjectId id;
private long timestamp;
private String server;
@Getter
@Setter
public class PKingdom {
private UUID uuid = UUID.randomUUID();
private Location rootLocation;
private Location spawnLocation;
private int size;
public class Location {
public String world;
public int x;
public int y;
public int z;
[16:25:47 ERROR]: java.lang.reflect.InvocationTargetException
[16:25:47 ERROR]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[16:25:47 ERROR]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[16:25:47 ERROR]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[16:25:47 ERROR]: at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisEventManager$EventClass.fire(RedisEventManager.java:199)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisEventManager$EventClass.access$500(RedisEventManager.java:166)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisEventManager$EventObject.fire(RedisEventManager.java:161)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisEventManager$EventObject.access$200(RedisEventManager.java:114)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisEventManager.fire(RedisEventManager.java:106)
[16:25:47 ERROR]: at dev.lightdream.redismanager.event.RedisEvent.fireEvent(RedisEvent.java:72)
[16:25:47 ERROR]: at dev.lightdream.redismanager.manager.RedisManager$1.lambda$onMessageReceive$0(RedisManager.java:152)
[16:25:47 ERROR]: at java.base/java.lang.Thread.run(Thread.java:833)
[16:25:47 ERROR]: Caused by: dev.morphia.query.ValidationException: Could not resolve path 'root_location.x' against 'com.pokeninjas.kingdoms.velocity.database.impl.EngineKingdom'. Unknown path element: 'root_location'.
[16:25:47 ERROR]: at dev.morphia.internal.PathTarget.failValidation(PathTarget.java:155)
[16:25:47 ERROR]: at dev.morphia.internal.PathTarget.resolve(PathTarget.java:184)
[16:25:47 ERROR]: at dev.morphia.internal.PathTarget.translatedPath(PathTarget.java:124)
[16:25:47 ERROR]: at dev.morphia.query.filters.Filter.path(Filter.java:167)
[16:25:47 ERROR]: at dev.morphia.query.filters.Filter.encode(Filter.java:66)
[16:25:47 ERROR]: at dev.morphia.query.filters.LogicalFilter.lambda$encode$0(LogicalFilter.java:40)
[16:25:47 ERROR]: at dev.morphia.aggregation.codecs.ExpressionHelper.document(ExpressionHelper.java:81)
[16:25:47 ERROR]: at dev.morphia.query.filters.LogicalFilter.encode(LogicalFilter.java:40)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.lambda$getQueryDocument$0(MorphiaQuery.java:392)
[16:25:47 ERROR]: at dev.morphia.aggregation.codecs.ExpressionHelper.document(ExpressionHelper.java:81)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.getQueryDocument(MorphiaQuery.java:389)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.toDocument(MorphiaQuery.java:265)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.iterable(MorphiaQuery.java:351)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.prepareCursor(MorphiaQuery.java:371)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.iterator(MorphiaQuery.java:228)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.first(MorphiaQuery.java:200)
[16:25:47 ERROR]: at dev.morphia.query.MorphiaQuery.first(MorphiaQuery.java:195)
[16:25:47 ERROR]: at com.pokeninjas.kingdoms.velocity.database.impl.EngineKingdom.get(EngineKingdom.java:84)
[16:25:47 ERROR]: at com.pokeninjas.kingdoms.velocity.module.kingdoms.manager.RedisListener.getKingdomFromLocation(RedisListener.java:56)
[16:25:47 ERROR]: at com.pokeninjas.kingdoms.velocity.module.kingdoms.manager.RedisListener.onKingdomRequest(RedisListener.java:38)
[16:25:47 ERROR]: ... 12 more