Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            triggerManager = new TriggerManager(this);

            Managers = new ObjectManagersResolver(this);
        }
Exemplo n.º 5
0
 public SequenceTableContainer(SequenceManager manager)
 {
     transaction = manager.Transaction;
     this.manager = manager;
 }
Exemplo n.º 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;
 }
Exemplo n.º 7
0
 public Sequence(SequenceManager manager, SqlNumber id, SequenceInfo sequenceInfo)
     : this(manager, id, SqlNumber.Null, sequenceInfo)
 {
 }