Beispiel #1
0
        // ReSharper disable UnusedMember.Local

        private static Tuple BuildPersistentTuple(Tuple tuple, Tuple tuplePrototype, int[] mapping)
        {
            var result = tuplePrototype.CreateNew();

            tuple.CopyTo(result, mapping);
            return(result);
        }
        public override Tuple GenerateKey(KeyInfo keyInfo, Session session)
        {
            var sequence = sequenceProvider.GetSequence(keyInfo.Sequence, session);
            var keyValue = sequence.GetNextValue(keyInfo.Sequence, session);
            var keyTuple = prototype.CreateNew();

            keyTuple.SetValue(0, keyValue);
            return(keyTuple);
        }
Beispiel #3
0
        /// <inheritdoc/>
        protected internal override Pair <Tuple, int> GetMappedContainer(int fieldIndex, bool isWriting)
        {
            Tuple tuple;

            if (isWriting)
            {
                if (difference == null)
                {
                    difference = origin.CreateNew();
                }
                tuple = difference;
            }
            else
            {
                tuple = difference != null && difference.GetFieldState(fieldIndex).IsAvailable()
          ? difference
          : origin;
            }
            return(tuple.GetMappedContainer(fieldIndex, isWriting));
        }