Re: No access to getObjectStore().getFlattenedInserts() / getFlattenedDeletes()

From: Mike Kienenberger (mkienen..mail.com)
Date: Tue Dec 20 2005 - 15:55:01 EST

  • Next message: Cris Daniluk: "Re: No access to getObjectStore().getFlattenedInserts() / getFlattenedDeletes()"

    Ok. Now that I have almost everything working, here's the additional
    changes I'm proposing. Basically making a bunch of useful classes
    and methods public.

    (The one issue I haven't been able to solve is how to get new
    generated dependent primary key information used in my inserted
    flattened relationships into my audit logs, but that's kind of a
    limitation of the framework, and I can probably live without it.)

    Index: FlattenedRelationshipUpdate.java
    ===================================================================
    RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/access/Attic/FlattenedRelationshipUpdate.java,v
    retrieving revision 1.2
    diff -u -r1.2 FlattenedRelationshipUpdate.java
    --- FlattenedRelationshipUpdate.java 19 Mar 2005 19:49:16 -0000 1.2
    +++ FlattenedRelationshipUpdate.java 20 Dec 2005 20:46:07 -0000
    ..-79,7 +79,7 @@
      *..ince 1.2 renamed from FlattenedRelationshipInfo
      *..uthor Andrei Adamchik
      */
    -final class FlattenedRelationshipUpdate extends RelationshipUpdate {
    +public final class FlattenedRelationshipUpdate extends RelationshipUpdate {

         FlattenedRelationshipUpdate(DataObject source, DataObject destination,
                 ObjRelationship relationship) {
    ..-90,7 +90,7 @@
         /**
          * Returns a join DbEntity for the single-step flattened relationship.
          */
    - DbEntity getJoinEntity() {
    + public DbEntity getJoinEntity() {
             List relList = relationship.getDbRelationships();
             if (relList.size() != 2) {
                 throw new CayenneRuntimeException(
    ..-105,7 +105,7 @@
         /**
          * Returns a snapshot for the join record for the single-step
    flattened relationship.
          */
    - Map buildJoinSnapshot() {
    + public Map buildJoinSnapshot() {

             List relList = relationship.getDbRelationships();
             if (relList.size() != 2) {

    Index: RelationshipUpdate.java
    ===================================================================
    RCS file: /cvsroot/cayenne/cayenne/src/cayenne/java/org/objectstyle/cayenne/access/Attic/RelationshipUpdate.java,v
    retrieving revision 1.2
    diff -u -r1.2 RelationshipUpdate.java
    --- RelationshipUpdate.java 19 Mar 2005 19:49:13 -0000 1.2
    +++ RelationshipUpdate.java 20 Dec 2005 20:46:44 -0000
    ..-154,25 +154,25 @@
                     .equals(update.destination));
         }

    - ObjRelationship getRelationship() {
    + public ObjRelationship getRelationship() {
             return relationship;
         }

    - ObjRelationship getReverseRelationship() {
    + public ObjRelationship getReverseRelationship() {
             return reverseRelationship;
         }

         /**
          * Returns the destination object of the relationship.
          */
    - DataObject getDestination() {
    + public DataObject getDestination() {
             return destination;
         }

         /**
          * Returns the source object of the relationship.
          */
    - DataObject getSource() {
    + public DataObject getSource() {
             return source;
         }

    On 12/20/05, Mike Kienenberger <mkienen..mail.com> wrote:
    > Andrus (and others),
    >
    > I'm trying to iterate through the uncommitted object set so I can
    > create auditing records, and one of my problems is that I don't have
    > access to uncommitted flattened object changes like I do for new,
    > modified, and deleted objects.
    >
    > How would you feel about adding the following methods to DataContext?
    >
    > public List newFlattenedObjects()
    > {
    > // maybe wrap in new ArrayList() first....
    > return getObjectStore().getFlattenedInserts();
    > }
    > public List deletedFlattenedObjects()
    > {
    > // maybe wrap in new ArrayList() first....
    > return getObjectStore().getFlattenedDeletes();
    > }
    >
    > Currently, I'm adding these methods in using a custom DataContext
    > subclass. However, I still have to make a local mod so that
    > org.objectstyle.cayenne.access.FlattenedRelationshipUpdate is visible.
    > At minimum, it would be helpful if
    > org.objectstyle.cayenne.access.FlattenedRelationshipUpdate was marked
    > public.
    >



    This archive was generated by hypermail 2.0.0 : Tue Dec 20 2005 - 15:55:03 EST