Re: Refresh?

From: Michael Gentry (mgentr..asslight.net)
Date: Fri Oct 29 2010 - 13:51:14 UTC

  • Next message: mahmoud sakr: "URGENT, Need Help Please"

    Cool, I'll take a stab at it later.

    Thanks,

    mrg

    On Fri, Oct 29, 2010 at 9:39 AM, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > Yeah I think we removed "refresh" as a query parameter. This is prolly a leftover. Let's deprecate them (and make sure we provide undeprecated flavor and call it within our code).
    >
    > Andrus
    >
    > On Oct 29, 2010, at 4:32 PM, Michael Gentry wrote:
    >
    >> I was looking at DataContext and am curious why we have "refresh" as a
    >> parameter to these methods when they aren't being used:
    >>
    >>
    >>   /**
    >>    * Creates a DataObject from DataRow.
    >>    *
    >>    *..ee DataRow
    >>    */
    >>   public <T extends DataObject> T objectFromDataRow(
    >>           Class<T> objectClass,
    >>           DataRow dataRow,
    >>           boolean refresh) {
    >>
    >>       ObjEntity entity =
    >> this.getEntityResolver().lookupObjEntity(objectClass);
    >>
    >>       if (entity == null) {
    >>           throw new CayenneRuntimeException("Unmapped Java class: "
    >> + objectClass);
    >>       }
    >>
    >>       ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
    >>               entity.getName());
    >>       List<T> list = objectsFromDataRows(descriptor,
    >> Collections.singletonList(dataRow));
    >>       return list.get(0);
    >>   }
    >>
    >>   /**
    >>    * Creates a DataObject from DataRow. This variety of the
    >> 'objectFromDataRow' method
    >>    * is normally used for generic classes.
    >>    *
    >>    *..ee DataRow
    >>    *..ince 3.0
    >>    */
    >>   public DataObject objectFromDataRow(
    >>           String entityName,
    >>           DataRow dataRow,
    >>           boolean refresh) {
    >>
    >>       ClassDescriptor descriptor =
    >> getEntityResolver().getClassDescriptor(entityName);
    >>       List<?> list = objectsFromDataRows(descriptor,
    >> Collections.singletonList(dataRow));
    >>
    >>       return (DataObject) list.get(0);
    >>   }
    >>
    >>
    >> Should we deprecate them?
    >>
    >> mrg
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Oct 29 2010 - 13:52:06 UTC