Re: ObjEntity returning related entity's ObjAttribute

From: Eric Schneider (eri..entralparksoftware.com)
Date: Thu Nov 03 2005 - 08:35:50 EST

  • Next message: Bryan Lewis: "Re: intermittent exception"

    Andrus,

    Thanks! I implemented my own method that does the same thing, but
    is far more disgusting. :-)

    I'll roll that back with this one-liner.

    Thanks again.
    e.

    On Nov 3, 2005, at 1:46 AM, Andrus Adamchik wrote:

    > Eric,
    >
    > ObjEntity.resolvePathComponents(Expression) returns an iterator
    > over the path components. So the last element of the iterator will
    > be the ObjAttribute your are looking for.
    >
    > IIRC you can also do something like this, but I haven't tried this
    > in a while:
    >
    > ObjAttribute a = (ObjAttribute) Expression.fromString(path).evaluate
    > (objEntity);
    >
    > Andrus
    >
    >
    >
    > On Nov 2, 2005, at 11:54 PM, Eric Schneider wrote:
    >
    >
    >> Hi,
    >>
    >> Not sure what's the best way to tackle this problem. I have a
    >> generic search page that's based on an ObjEntity and a subset of
    >> ObjAttributes. I use the ObjAttribute's java type to determine
    >> how to properly build the qualifier for the property.
    >>
    >> For example, I have an entity, Patient, and I allow them to search
    >> on the following properties:
    >>
    >> firstName
    >> lastName
    >> patientNumber
    >> dateOfBirth
    >> case.enteredOn
    >>
    >> All is fine until I get to "case.enteredOn", simply because it's
    >> not an ObjAttribute on Patient, it's an ObjAttribute on a related
    >> ObjEntity (Case). Anyone know of API that will allow me to
    >> retrieve this related Attribute with an ObjEntity and a property
    >> path?
    >>
    >> I imagining something like this would be really helpful right now:
    >>
    >> ObjAttribute attribute = (ObjAttribute)
    >> objEntity.getRelatedAttributeForPropertyPath("case.enteredOn");
    >>
    >> Unfortunately, it doesn't exist. Just checking for alternatives
    >> out there before attempting to write something similar.
    >>
    >> Thanks in advance.
    >> Eric
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Thu Nov 03 2005 - 08:35:59 EST