I'm using ObjectDB with JPA. I would like to call myMethod(). For example:
entityManager.createQuery("SELECT ... FROM ... WHERE MyClass.myMethod() = 100")
Is it possible? Maybe any annotation is required before method in the class?
@Entity
public class MyClass implements Serializable {
@Basic
private int x;
@Basic
private int y;
public int myMethod() {
return x*1000+y;
}
}
... MyClass data data.x * 1000 = 100 - data.y
in the query. – Shaffer