Task #292 (new)
Opened 18 years ago
Use generated constant field names in criteria queries
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | trivial | Milestone: | Unscheduled |
Component: | Queries | Version: | 3.0-M3 |
Keywords: | refactor | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description
All model objects have public final static constants with their field names. Though these have to be parsed with LsidUtils doing this statically wouldn't effect performance. E.g.
import ome.tools.lsid.LsidUtils; public class Example extends Query { private static String pix_field = LsidUtils.parseField(Image.DEFAULTPIXELS); protected void buildQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(Image.class); Criteria pix = c.createCriteria(pix_field,LEFT_JOIN); ...
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.