Applied patch from Jan Limpens 'ReflectionBasedDictionaryAdapter needs to check if...
[castle.git] / ActiveRecord / Castle.ActiveRecord.Tests / Model / GenericModel / Employee.cs
bloba7a7f392bcab9c2811e5967e0150dc44d4a51bd1
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.ActiveRecord.Tests.Model.GenericModel
17 using System;
19 [ActiveRecord( "Employee" )]
20 public class Employee : ActiveRecordBase<Employee>
22 private int id;
23 private string firstName;
24 private string lastName;
25 private Award award;
27 [PrimaryKey( PrimaryKeyType.Native, "EmployeeID" )]
28 public int ID
30 get { return this.id; }
31 set { this.id = value; }
34 [Property]
35 public string FirstName
37 get { return this.firstName; }
38 set { this.firstName = value; }
41 [Property]
42 public string LastName
44 get { return this.lastName; }
45 set { this.lastName = value; }
48 [OneToOne]
49 public Award Award
51 get { return this.award; }
52 set { this.award = value; }
58 [ActiveRecord( "Award" )]
59 public class Award : ActiveRecordBase<Award>
61 private Employee employee;
62 private string description;
63 private int id;
65 public Award()
69 public Award( Employee employee )
71 this.employee = employee;
74 [OneToOne]
75 public Employee Employee
77 get { return this.employee; }
78 set { this.employee = value; }
81 [PrimaryKey( PrimaryKeyType.Foreign, "EmployeeID" )]
82 public int ID
84 get { return this.id; }
85 set { this.id = value; }
88 [Property]
89 public string Description
91 get { return this.description; }
92 set { this.description = value; }