cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Refresh?
Date Fri, 29 Oct 2010 13:32:52 GMT
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