users@glassfish.java.net

query on a value derived from a method

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 May 2007 10:32:15 PDT

I am trying the following query using EJB3 Persistance API on glassfish.

SELECT object(o) FROM House as o WHERE o.getEstimatedMonthlyPayment BETWEEN :startPrice AND :endPrice


Exception: Unknown state or association field

getEstimatedMonthlyPayment: is a method which returns a double value, but does not have a property associated with it.

Is this possible? if not is there a way to accomplish this?
I do not want to store the result of this method in the database.
[Message sent by forum member 'berridge' (berridge)]

http://forums.java.net/jive/thread.jspa?messageID=218775