Re: SelectQuery and new objects

From: Mike Kienenberger (mkienen..mail.com)
Date: Mon May 19 2008 - 15:34:11 EDT

  • Next message: Dirk Lattermann: "Re: SelectQuery and new objects"

    It's true for all queries, but you can always ask the ObjectContext or
    DataContext for the list of new objects:

    public interface ObjectContext extends Serializable {

        /**
         * Returns a collection of objects that are registered with this
    ObjectContext and
         * have a state PersistenceState.NEW
         */
        Collection<?> newObjects();

    public class DataContext extends BaseContext implements DataChannel {

        /**
         * Returns a list of objects that are registered with this
    DataContext and have a
         * state PersistenceState.NEW
         */
       ..verride
        public Collection<?> newObjects() {
            return getObjectStore().objectsInState(PersistenceState.NEW);
        }

    On 5/19/08, Dirk Lattermann <dlat..lqualonde.de> wrote:
    > Am Montag, den 19.05.2008, 14:20 -0500 schrieb Robert Zeigler:
    >
    > > The select query is going to run against data in the database, and
    > > will therefore /not/ return newly created but as yet uncommitted
    > > objects.
    > >
    >
    >
    > Aha, thank you! Is this true for all Query classes in Cayenne? In other
    > words, is there a Query (or some other means) to fetch uncommitted
    > objects?
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon May 19 2008 - 15:34:44 EDT