cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: Refresh?
Date Fri, 29 Oct 2010 13:51:14 GMT
Cool, I'll take a stab at it later.

Thanks,

mrg


On Fri, Oct 29, 2010 at 9:39 AM, Andrus Adamchik <andrus@objectstyle.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.
>>    *
>>    * @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
>>
>
>

Mime
View raw message