Commits

Anonymous committed 59e98dd

Confused. I think I'm going to remove GeneratingValue & GeneratingValueRef

Comments (0)

Files changed (1)

Usually/Resolve.cs

         }
         public string Expression { get { return this._expression; } }
         public int Id { get { return this._id; } }
-        public GeneratedValue CreateRef()
+        public GeneratingValueRef CreateRef()
         {
-            return new GeneratedValue(this._id);
+            return new GeneratingValueRef(this._id);
         }
     }
-    public sealed class GeneratedValue
+    public sealed class GeneratingValueRef
     {
-        private int _key;
-        public GeneratedValue(int key)
+        private int _id;
+        public GeneratingValueRef(int id)
         {
-            this._key = key;
+            this._id = id;
         }
-        public int Key { get { return this._key; } }
+        public int Id { get { return this._id; } }
     }
     public interface ITransactor
     {
         object[] GetKey(T obj);
         void ForEachKey(T obj, Action<string, object> action);
         void ForEachExtraKey(string group, T obj, Action<string, object> action);
-        void ForEachInsertValue(Func<string, object> newgen, T obj, Action<string, object> action);
+        void ForEachInsertValue(Func<string, GeneratingValue> newgen, T obj, Action<string, object> action);
         void ForEachValueChange(T o, T n, Action<string, object, object> action);
     }
 
         {
             this.extraKeys[group].ForEach(obj, action);
         }
-        void IMetaInfo<T>.ForEachInsertValue(Func<string, object> newgen, T obj, Action<string, object> action)
+        void IMetaInfo<T>.ForEachInsertValue(Func<string, GeneratingValue> newgen, T obj, Action<string, object> action)
         {
             var done = new HashSet<string>();
             Action<KeysDef, string, object> addKey = (keys, k, v) =>
     {
         public struct Insertion
         {
-            public InsertRecord Record;
-            public T Object;
+            public TransactionRecord Record;
+            public object Object;
         }
         private int nextGenId = 1;
         private IMetaInfo<T> info = null;
         {
             return from i in this.ReconcileInsertion() select i.Record;
         }
-        public IEnumerable<TransactionRecord> ReconcileUpdateAndDelete()
+        public IEnumerable<TransactionRecord> ReconcileUpdateOrDelete()
         {
             foreach (var o in this.olds)
             {
         }
         public IEnumerable<TransactionRecord> Reconcile()
         {
-            return this.ReconcileInsert().Union(this.ReconcileUpdateAndDelete());
+            return this.ReconcileInsert().Union(this.ReconcileUpdateOrDelete());
         }
     }
+    public class TransactionJournal
+    {        
+    }
+    public class InsertJournal: TransactionJournal
+    {
+        public InsertRecord Record { get; set; }
+        public List<InsertJournal> DetailInsert = new List<InsertJournal>();
+        public List<UpdateRecord> DetailUpdate = new List<UpdateRecord>();
+    }
+    public class DeleteJournal: TransactionJournal
+    {
+        public DeleteRecord Record { get; set; }
+        public List<DeleteJournal> DetailDelete = new List<DeleteJournal>();
+        public List<DeleteJournal> DetailCascade = new List<DeleteJournal>();
+    }
     public class Resolver
     {
         public const int DEFAULT_DUMMY_START = -1;
                     }
                 }
             }
-            return r.ReconcileInsert().Union(r.ReconcileUpdateAndDelete());
+            return r.ReconcileInsert().Union(r.ReconcileUpdateOrDelete());
         }
     }
 }