Пример #1
0
        // possiveis consultas
        // Listar todos os alunos de determinado professor
        // Listar alunos com nota abaixo de x
        // Listar disciplinas que um professor ministrou no semestre
        /// <exception cref="System.Exception"></exception>
        public virtual void Test1()
        {
            if (!isLocal)
            {
                return;
            }
            NeoDatis.Odb.ODB odb = Open("t-school.neodatis");
            // List students by name
            SchoolNativeQueryStudent natQuery = new SchoolNativeQueryStudent("Brenna", 23);

            NeoDatis.Odb.Objects <Student> students  = odb.GetObjects <Student>(natQuery);
            SchoolSimpleNativeQueryStudent sNatQuery = new SchoolSimpleNativeQueryStudent("Brenna");

            students = odb.GetObjects <Student>(sNatQuery);
            // list disciplines of one teacher by semester
            SchoolNativeQueryTeacher natQuery2 = new SchoolNativeQueryTeacher
                                                     ("Jeremias");

            NeoDatis.Odb.Objects <History> historys       = odb.GetObjects <History>(natQuery2);
            System.Collections.Hashtable   listDiscipline = new NeoDatis.Tool.Wrappers.Map.OdbHashMap <string, Discipline>();
            for (System.Collections.IEnumerator iter = historys.GetEnumerator(); iter.MoveNext
                     ();)
            {
                History h = (History)iter
                            .Current;
                listDiscipline.Add(h.GetDiscipline().GetName(), h.GetDiscipline());
            }
            odb.Close();
        }
Пример #2
0
        public virtual void Test1()
		{
			if (!isLocal)
			{
				return;
			}
			NeoDatis.Odb.ODB odb = Open("t-school.neodatis");
			// List students by name
			SchoolNativeQueryStudent natQuery = new SchoolNativeQueryStudent("Brenna", 23);
			NeoDatis.Odb.Objects<Student> students = odb.GetObjects<Student>(natQuery);
			SchoolSimpleNativeQueryStudent sNatQuery = new SchoolSimpleNativeQueryStudent("Brenna");
			students = odb.GetObjects<Student>(sNatQuery);
			// list disciplines of one teacher by semester
			SchoolNativeQueryTeacher natQuery2 = new SchoolNativeQueryTeacher
				("Jeremias");
			NeoDatis.Odb.Objects<History> historys = odb.GetObjects<History>(natQuery2);
			System.Collections.Hashtable listDiscipline = new NeoDatis.Tool.Wrappers.Map.OdbHashMap<string,Discipline>();
			for (System.Collections.IEnumerator iter = historys.GetEnumerator(); iter.MoveNext
				(); )
			{
				History h = (History)iter
					.Current;
				listDiscipline.Add(h.GetDiscipline().GetName(), h.GetDiscipline());
			}
			odb.Close();
		}