Re: Suggestion for lookupObjEntity()

From: Craig Miskell (cmiskel..lbatross.co.nz)
Date: Sat Nov 16 2002 - 21:06:45 EST

  • Next message: Craig Miskell: "Re: Callback methods [Was: createPermId in DataContext]"

    On Sat, 16 Nov 2002, Andrus wrote:

    > At 05:18 PM 11/16/2002 +0100, Holger Hoffstätte wrote:
    >
    > >I just accidentally passed an instance of DataObject into lookupEntity()
    > >(instead of the Class) and of course got a null back. Any reason why we
    > >shouldn't handle this case as well? A simple
    > >
    > > if (object instanceof DataObject) {
    > > object = object.getClass();
    > > }
    > >
    > >could help and make it more generic without disturbing the rest of the
    > >method.
    >
    > I think this wouldn't hurt. I have no objections to this.
    +1. Very good idea. In fact, some bits of code (QueryHelper springs to
    mind) currently have to pass dataObject.getClass() to the resolver. This
    would subtly simplify them as well.

    Craig



    This archive was generated by hypermail 2.0.0 : Sat Nov 16 2002 - 21:03:53 EST