예제 #1
0
        public void CreateNormalSequence()
        {
            var sequenceManager = new SequenceManager(transaction);

            var sequenceName = ObjectName.Parse("APP.test_sequence");
            var seqInfo = new SequenceInfo(sequenceName, new SqlNumber(0), new SqlNumber(1), new SqlNumber(0), new SqlNumber(Int64.MaxValue), 126);

            ISequence sequence =null;
            Assert.DoesNotThrow(() => sequence = sequenceManager.CreateSequence(seqInfo));
            Assert.IsNotNull(sequence);
        }
예제 #2
0
        public void CreateNativeSequence()
        {
            var sequenceManager = new SequenceManager(transaction);

            var tableName = ObjectName.Parse("APP.test_table");
            var seqInfo = SequenceInfo.Native(tableName);

            ISequence sequence = null;
            Assert.DoesNotThrow(() => sequence = sequenceManager.CreateSequence(seqInfo));
            Assert.IsNotNull(sequence);
        }
예제 #3
0
        public void IncremementSequenceValue()
        {
            var sequenceManager = new SequenceManager(transaction);

            ISequence sequence = null;
            Assert.DoesNotThrow(() => sequence = sequenceManager.GetSequence(testSequenceName));
            Assert.IsNotNull(sequence);

            SqlNumber currentValue = SqlNumber.Null;
            Assert.DoesNotThrow(() => currentValue = sequence.NextValue());
            Assert.IsNotNull(currentValue);
            Assert.AreEqual(new SqlNumber(1), currentValue);
        }
예제 #4
0
        private void InitManagers()
        {
            schemaManager = new SchemaManager(this);
            tableManager = new TableManager(this, TableComposite);
            sequenceManager = new SequenceManager(this);
            viewManager = new ViewManager(this);
            variableManager = new VariableManager(this);

            Managers = new ObjectManagersResolver(this);
        }
예제 #5
0
 public SequenceTableContainer(SequenceManager manager)
 {
     transaction = manager.Transaction;
     this.manager = manager;
 }
예제 #6
0
 public Sequence(SequenceManager manager, SqlNumber id, SqlNumber lastValue, SequenceInfo sequenceInfo)
 {
     this.manager = manager;
     Id = id;
     FullName = sequenceInfo.SequenceName;
     SequenceInfo = sequenceInfo;
     LastValue = lastValue;
     CurrentValue = lastValue;
 }
예제 #7
0
 public Sequence(SequenceManager manager, SqlNumber id, SequenceInfo sequenceInfo)
     : this(manager, id, SqlNumber.Null, sequenceInfo)
 {
 }