java - Ebean query; using an object in the WHERE clause -
I have a stock item class in which there is an area which is a warehouse item, to find all the stockitim in a certain warehouse. I want to run an EBI query:
list & lt; Stockitum & gt; Results = stockItim.Fund () .jp () .eq ("warehouse", warehouse). Fundlist (); But, the result is always the size of 0, even when there are stock items in the database with the given warehouse I have overridden in the warehouse class () is equal to
If I ask for a list of all stock items and then check the parity on the warehouse fields, then I can find the warehouse I am looking for:
String result string; & Lt; StockItem & gt; Results = stockItim.Fund (). FindList (); If (result.get (0) .warehouse.equals (warehouse)) {resultString = "success"; } Is this the only way to do this?
Edit: Me is equal to Warehouse ()
@ Override public boolean par (object o) {if (o instance gourehouse) {Warehouse other = (godown) O; Return name Angle (other name) & amp; Amp; address.equals (other.address); } Other {return false; }}
I do not know what is EBI but Can you try to do something like that? list & lt; Stockitum & gt; Results = StockItim.Fund () .jp () .eq ("warehouse.id", warehouse.getid ()). Fundlist ();
Comments
Post a Comment