Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #292 (new)

Opened 13 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);
...

Change History (0)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.73880 sec.)

We're Hiring!