Refresh?

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

  • Next message: Andrus Adamchik: "Re: Refresh?"

    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:33:50 UTC