public virtual void MergeSequence(Net.Vpc.Upa.Config.Decoration gid) { specified = true; if (gid.GetConfig().GetOrder() >= configOrder) { specified = true; if (gid.GetInt("allocationSize") != System.Int32.MinValue) { allocationSize = gid.GetInt("allocationSize"); } if (gid.GetInt("initialValue") != System.Int32.MinValue) { initialValue = gid.GetInt("initialValue"); } if ((gid.GetString("format")).Length > 0) { format = gid.GetString("format"); } if ((gid.GetString("group")).Length > 0) { group = gid.GetString("group"); } if (!System.Collections.Generic.EqualityComparer <Net.Vpc.Upa.SequenceType> .Default.Equals(gid.GetEnum <Net.Vpc.Upa.SequenceType>("type", typeof(Net.Vpc.Upa.SequenceType)), Net.Vpc.Upa.SequenceType.DEFAULT)) { sequenceType = gid.GetEnum <Net.Vpc.Upa.SequenceType>("type", typeof(Net.Vpc.Upa.SequenceType)); } if ((gid.GetString("name")).Length > 0) { name = gid.GetString("name"); } if (!System.Collections.Generic.EqualityComparer <Net.Vpc.Upa.SequenceStrategy> .Default.Equals(gid.GetEnum <Net.Vpc.Upa.SequenceStrategy>("strategy", typeof(Net.Vpc.Upa.SequenceStrategy)), Net.Vpc.Upa.SequenceStrategy.UNSPECIFIED)) { strategy = gid.GetEnum <Net.Vpc.Upa.SequenceStrategy>("strategy", typeof(Net.Vpc.Upa.SequenceStrategy)); } if (gid.GetInt("formulaOrder") != System.Int32.MinValue) { formulaOrder = gid.GetInt("formulaOrder"); } if (gid.GetConfig().GetOrder() > configOrder) { configOrder = gid.GetConfig().GetOrder(); } } }
public virtual void MergeSequence(Net.Vpc.Upa.Config.Decoration formulaInfo) { Net.Vpc.Upa.SequenceType stype = formulaInfo.GetEnum <Net.Vpc.Upa.SequenceType>("type", typeof(Net.Vpc.Upa.SequenceType)); Net.Vpc.Upa.FormulaType[] types = null; switch (stype) { case Net.Vpc.Upa.SequenceType.DEFAULT: case Net.Vpc.Upa.SequenceType.PERSIST: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST }; break; } case Net.Vpc.Upa.SequenceType.UPDATE: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.UPDATE }; break; } case Net.Vpc.Upa.SequenceType.BOTH: { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST, Net.Vpc.Upa.FormulaType.UPDATE }; break; } } if (types.Length == 0) { types = new Net.Vpc.Upa.FormulaType[] { Net.Vpc.Upa.FormulaType.PERSIST, Net.Vpc.Upa.FormulaType.UPDATE }; } foreach (Net.Vpc.Upa.FormulaType type in types) { object o = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <Net.Vpc.Upa.FormulaType, object>(all, type); Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo old = (o is Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo) ? (Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo)o : null; if (old == null) { old = new Net.Vpc.Upa.Impl.Config.Annotationparser.SequenceInfo(repo); old.configOrder = System.Int32.MinValue; all[type] = old; } old.MergeSequence(formulaInfo); } }