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.
>    *
>    * @see 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.
>    *
>    * @see DataRow
>    * @since 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
> 

Reply via email to