Example #1
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Test3()
 {
     if (!isLocal)
     {
         return;
     }
     NeoDatis.Odb.ODB     odb = Open("get.neodatis");
     NeoDatis.Odb.Objects l   = odb.GetObjects(new _SimpleNativeQuery_105());
     odb.Close();
     AssertFalse(l.IsEmpty());
     AssertEquals(3, l.Count);
 }
Example #2
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Test1()
 {
     NeoDatis.Odb.ODB     odb = Open("cache.neodatis");
     NeoDatis.Odb.Objects l   = odb.GetObjects(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                   (typeof(NeoDatis.Odb.Test.VO.Login.Function), NeoDatis.Odb.Core.Query.Criteria.Where
                                                   .Equal("name", "function 10")));
     AssertFalse(l.IsEmpty());
     // Cache must have only one object : The function
     AssertEquals(l.Count, NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.Dummy.GetEngine
                      (odb).GetSession(true).GetCache().GetNumberOfObjects());
     odb.Close();
 }
Example #3
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Test5()
 {
     if (!isLocal)
     {
         return;
     }
     NeoDatis.Odb.ODB odb = Open("get.neodatis");
     NeoDatis.Odb.Core.Query.NQ.SimpleNativeQuery query = new _SimpleNativeQuery_139();
     NeoDatis.Odb.Objects l = odb.GetObjects(query, true, 5, 6);
     odb.Close();
     AssertFalse(l.IsEmpty());
     AssertEquals(1, l.Count);
 }
Example #4
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Test2()
 {
     NeoDatis.Odb.ODB     odb = Open("cache.neodatis");
     NeoDatis.Odb.Objects l   = odb.GetObjects(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                   (typeof(NeoDatis.Odb.Test.VO.Login.User), NeoDatis.Odb.Core.Query.Criteria.Where
                                                   .Equal("name", "olivier 10")));
     AssertFalse(l.IsEmpty());
     // Cache must have 3 times the number of Users in list l (check the
     // setup method to understand this)
     AssertEquals(l.Count * 3, NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.Dummy.GetEngine
                      (odb).GetSession(true).GetCache().GetNumberOfObjects());
     odb.Close();
 }
Example #5
0
 /// <exception cref="System.Exception"></exception>
 public virtual void Test2()
 {
     if (!isLocal)
     {
         return;
     }
     NeoDatis.Odb.ODB odb = Open("get.neodatis");
     // println("++++TestNQQuery.test2:"+odb.getObjects
     // (Function.class,true));
     NeoDatis.Odb.Objects l = odb.GetObjects(new _SimpleNativeQuery_89());
     odb.Close();
     AssertFalse(l.IsEmpty());
     AssertEquals(1, l.Count);
 }
Example #6
0
 // println("NbFunctions " + odb.count(Function.class));
 // println("NbUsers " + odb.count(User.class));
 /// <exception cref="System.Exception"></exception>
 public virtual void Test1()
 {
     if (!isLocal)
     {
         return;
     }
     NeoDatis.Odb.ODB odb = Open("get.neodatis");
     odb.GetObjects(typeof(NeoDatis.Odb.Test.VO.Login.Function), true);
     odb.Close();
     odb = Open("get.neodatis");
     // println("TestNQQuery.test1:"+odb.getObjects (Function.class,true));
     NeoDatis.Odb.Objects l = odb.GetObjects(new _SimpleNativeQuery_70());
     odb.Close();
     AssertFalse(l.IsEmpty());
     AssertEquals(NbObjects * 4, l.Count);
 }
Example #7
0
        /// <summary>
        /// Actually gets the next id Gets the object of type ID from the database
        /// with the specific name.
        /// </summary>
        /// <remarks>
        /// Actually gets the next id Gets the object of type ID from the database
        /// with the specific name. Then increment the id value and returns. If
        /// object does not exist, creates t.
        /// </remarks>
        /// <param name="idName"></param>
        /// <returns></returns>
        private long GetNextId(string idName)
        {
            NeoDatis.Odb.ODB     odb     = GetOdb();
            NeoDatis.Odb.Objects objects = odb.GetObjects(new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                              (typeof(NeoDatis.Odb.Test.Trigger.ID), NeoDatis.Odb.Core.Query.Criteria.Where.Equal
                                                                  ("idName", idName)));
            if (objects.IsEmpty())
            {
                NeoDatis.Odb.Test.Trigger.ID id1 = new NeoDatis.Odb.Test.Trigger.ID(idName, 1);
                odb.Store(id1);
                return(1);
            }
            NeoDatis.Odb.Test.Trigger.ID id = (NeoDatis.Odb.Test.Trigger.ID)objects.GetFirst(
                );
            long lid = id.GetNext();

            odb.Store(id);
            return(lid);
        }