Example #1
0
 public Player(string name, System.DateTime birthDate, NeoDatis.Odb.Test.VO.Sport.Sport
               favoriteSport)
 {
     this.name          = name;
     this.birthDate     = birthDate;
     this.favoriteSport = favoriteSport;
 }
Example #2
0
		public Player(string name, System.DateTime birthDate, NeoDatis.Odb.Test.VO.Sport.Sport
			 favoriteSport)
		{
			this.name = name;
			this.birthDate = birthDate;
			this.favoriteSport = favoriteSport;
		}
Example #3
0
		public Game(System.DateTime when, NeoDatis.Odb.Test.VO.Sport.Sport sport, NeoDatis.Odb.Test.VO.Sport.Team
			 team1, NeoDatis.Odb.Test.VO.Sport.Team team2)
		{
			this.when = when;
			this.sport = sport;
			this.team1 = team1;
			this.team2 = team2;
		}
Example #4
0
 public Game(System.DateTime when, NeoDatis.Odb.Test.VO.Sport.Sport sport, NeoDatis.Odb.Test.VO.Sport.Team
             team1, NeoDatis.Odb.Test.VO.Sport.Team team2)
 {
     this.when  = when;
     this.sport = sport;
     this.team1 = team1;
     this.team2 = team2;
 }
Example #5
0
 /// <summary>Test select objects that are not yet commited.</summary>
 /// <remarks>
 /// Test select objects that are not yet commited. It also test the meta
 /// model class reference for in transaction class creation
 /// </remarks>
 /// <exception cref="System.Exception">System.Exception</exception>
 public virtual void TestSelectUnCommitedObject3()
 {
     DeleteBase(BaseName);
     // Create instance
     NeoDatis.Odb.Test.VO.Sport.Sport sport = new NeoDatis.Odb.Test.VO.Sport.Sport("volley-ball"
                                                                                   );
     NeoDatis.Odb.ODB odb = null;
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Store the object
         odb.Store(sport);
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Let's insert a tennis player
         NeoDatis.Odb.Test.VO.Sport.Player agassi = new NeoDatis.Odb.Test.VO.Sport.Player(
             "André Agassi", new System.DateTime(), new NeoDatis.Odb.Test.VO.Sport.Sport("Tennis"
                                                                                          ));
         odb.Store(agassi);
         NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
                                                    .Equal("favoriteSport.name", "volley-ball"));
         NeoDatis.Odb.Objects players = odb.GetObjects(query);
         Println("\nStep 4 : Players of Voller-ball");
         int i = 1;
         // display each object
         while (players.HasNext())
         {
             Println((i++) + "\t: " + players.Next());
         }
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     DeleteBase(BaseName);
 }
Example #6
0
		public virtual void SetFavoriteSport(NeoDatis.Odb.Test.VO.Sport.Sport favoriteSport
			)
		{
			this.favoriteSport = favoriteSport;
		}
Example #7
0
		public virtual void SetSport(NeoDatis.Odb.Test.VO.Sport.Sport sport)
		{
			this.sport = sport;
		}
Example #8
0
 public virtual void SetSport(NeoDatis.Odb.Test.VO.Sport.Sport sport)
 {
     this.sport = sport;
 }
Example #9
0
 public virtual void SetFavoriteSport(NeoDatis.Odb.Test.VO.Sport.Sport favoriteSport
                                      )
 {
     this.favoriteSport = favoriteSport;
 }
Example #10
0
		/// <summary>Test select objects that are not yet commited.</summary>
		/// <remarks>
		/// Test select objects that are not yet commited. It also test the meta
		/// model class reference for in transaction class creation
		/// </remarks>
		/// <exception cref="System.Exception">System.Exception</exception>
		public virtual void TestSelectUnCommitedObject3()
		{
			DeleteBase(BaseName);
			// Create instance
			NeoDatis.Odb.Test.VO.Sport.Sport sport = new NeoDatis.Odb.Test.VO.Sport.Sport("volley-ball"
				);
			NeoDatis.Odb.ODB odb = null;
			try
			{
				// Open the database
				odb = Open(BaseName);
				// Store the object
				odb.Store(sport);
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			try
			{
				// Open the database
				odb = Open(BaseName);
				// Let's insert a tennis player
				NeoDatis.Odb.Test.VO.Sport.Player agassi = new NeoDatis.Odb.Test.VO.Sport.Player(
					"André Agassi", new System.DateTime(), new NeoDatis.Odb.Test.VO.Sport.Sport("Tennis"
					));
				odb.Store(agassi);
				NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
					(typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
					.Equal("favoriteSport.name", "volley-ball"));
				NeoDatis.Odb.Objects players = odb.GetObjects(query);
				Println("\nStep 4 : Players of Voller-ball");
				int i = 1;
				// display each object
				while (players.HasNext())
				{
					Println((i++) + "\t: " + players.Next());
				}
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			DeleteBase(BaseName);
		}
Example #11
0
		/// <summary>Test select objects that are not yet commited</summary>
		/// <exception cref="System.Exception">System.Exception</exception>
		public virtual void TestSelectUnCommitedObject4()
		{
			DeleteBase(BaseName);
			// Create instance
			NeoDatis.Odb.Test.VO.Sport.Sport sport = new NeoDatis.Odb.Test.VO.Sport.Sport("volley-ball"
				);
			NeoDatis.Odb.ODB odb = null;
			try
			{
				// Open the database
				odb = Open(BaseName);
				// Store the object
				odb.Store(sport);
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			// Create instance
			NeoDatis.Odb.Test.VO.Sport.Sport volleyball = new NeoDatis.Odb.Test.VO.Sport.Sport
				("volley-ball");
			// Create 4 players
			NeoDatis.Odb.Test.VO.Sport.Player player1 = new NeoDatis.Odb.Test.VO.Sport.Player
				("olivier", new System.DateTime(), volleyball);
			NeoDatis.Odb.Test.VO.Sport.Player player2 = new NeoDatis.Odb.Test.VO.Sport.Player
				("pierre", new System.DateTime(), volleyball);
			NeoDatis.Odb.Test.VO.Sport.Player player3 = new NeoDatis.Odb.Test.VO.Sport.Player
				("elohim", new System.DateTime(), volleyball);
			NeoDatis.Odb.Test.VO.Sport.Player player4 = new NeoDatis.Odb.Test.VO.Sport.Player
				("minh", new System.DateTime(), volleyball);
			// Create two teams
			NeoDatis.Odb.Test.VO.Sport.Team team1 = new NeoDatis.Odb.Test.VO.Sport.Team("Paris"
				);
			NeoDatis.Odb.Test.VO.Sport.Team team2 = new NeoDatis.Odb.Test.VO.Sport.Team("Montpellier"
				);
			// Set players for team1
			team1.AddPlayer(player1);
			team1.AddPlayer(player2);
			// Set players for team2
			team2.AddPlayer(player3);
			team2.AddPlayer(player4);
			// Then create a volley ball game for the two teams
			NeoDatis.Odb.Test.VO.Sport.Game game = new NeoDatis.Odb.Test.VO.Sport.Game(new System.DateTime
				(), volleyball, team1, team2);
			odb = null;
			try
			{
				// Open the database
				odb = Open(BaseName);
				// Store the object
				odb.Store(game);
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			try
			{
				// Open the database
				odb = Open(BaseName);
				NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
					(typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
					.Equal("name", "olivier"));
				NeoDatis.Odb.Objects players = odb.GetObjects(query);
				Println("\nStep 3 : Players with name olivier");
				int i = 1;
				// display each object
				while (players.HasNext())
				{
					Println((i++) + "\t: " + players.Next());
				}
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			try
			{
				// Open the database
				odb = Open(BaseName);
				// Let's insert a tennis player
				NeoDatis.Odb.Test.VO.Sport.Player agassi = new NeoDatis.Odb.Test.VO.Sport.Player(
					"André Agassi", new System.DateTime(), new NeoDatis.Odb.Test.VO.Sport.Sport("Tennis"
					));
				NeoDatis.Odb.OID oid = odb.Store(agassi);
				NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
					(typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
					.Equal("favoriteSport.name", "volley-ball"));
				NeoDatis.Odb.Objects players = odb.GetObjects(query);
				Println("\nStep 4 : Players of Voller-ball");
				int i = 1;
				// display each object
				while (players.HasNext())
				{
					Println((i++) + "\t: " + players.Next());
				}
			}
			finally
			{
				if (odb != null)
				{
					// Close the database
					odb.Close();
				}
			}
			DeleteBase(BaseName);
		}
Example #12
0
 /// <summary>Test select objects that are not yet commited</summary>
 /// <exception cref="System.Exception">System.Exception</exception>
 public virtual void TestSelectUnCommitedObject4()
 {
     DeleteBase(BaseName);
     // Create instance
     NeoDatis.Odb.Test.VO.Sport.Sport sport = new NeoDatis.Odb.Test.VO.Sport.Sport("volley-ball"
                                                                                   );
     NeoDatis.Odb.ODB odb = null;
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Store the object
         odb.Store(sport);
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     // Create instance
     NeoDatis.Odb.Test.VO.Sport.Sport volleyball = new NeoDatis.Odb.Test.VO.Sport.Sport
                                                       ("volley-ball");
     // Create 4 players
     NeoDatis.Odb.Test.VO.Sport.Player player1 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("olivier", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player2 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("pierre", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player3 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("elohim", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player4 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("minh", new System.DateTime(), volleyball);
     // Create two teams
     NeoDatis.Odb.Test.VO.Sport.Team team1 = new NeoDatis.Odb.Test.VO.Sport.Team("Paris"
                                                                                 );
     NeoDatis.Odb.Test.VO.Sport.Team team2 = new NeoDatis.Odb.Test.VO.Sport.Team("Montpellier"
                                                                                 );
     // Set players for team1
     team1.AddPlayer(player1);
     team1.AddPlayer(player2);
     // Set players for team2
     team2.AddPlayer(player3);
     team2.AddPlayer(player4);
     // Then create a volley ball game for the two teams
     NeoDatis.Odb.Test.VO.Sport.Game game = new NeoDatis.Odb.Test.VO.Sport.Game(new System.DateTime
                                                                                    (), volleyball, team1, team2);
     odb = null;
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Store the object
         odb.Store(game);
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     try
     {
         // Open the database
         odb = Open(BaseName);
         NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
                                                    .Equal("name", "olivier"));
         NeoDatis.Odb.Objects players = odb.GetObjects(query);
         Println("\nStep 3 : Players with name olivier");
         int i = 1;
         // display each object
         while (players.HasNext())
         {
             Println((i++) + "\t: " + players.Next());
         }
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Let's insert a tennis player
         NeoDatis.Odb.Test.VO.Sport.Player agassi = new NeoDatis.Odb.Test.VO.Sport.Player(
             "André Agassi", new System.DateTime(), new NeoDatis.Odb.Test.VO.Sport.Sport("Tennis"
                                                                                          ));
         NeoDatis.Odb.OID oid = odb.Store(agassi);
         NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
                                                    .Equal("favoriteSport.name", "volley-ball"));
         NeoDatis.Odb.Objects players = odb.GetObjects(query);
         Println("\nStep 4 : Players of Voller-ball");
         int i = 1;
         // display each object
         while (players.HasNext())
         {
             Println((i++) + "\t: " + players.Next());
         }
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     DeleteBase(BaseName);
 }