1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
.Nested
20 public class NestedWithPrefix
: ActiveRecordBase
23 private Name self
, other
;
25 [PrimaryKey(PrimaryKeyType
.Native
)]
28 get { return this.id; }
29 set { this.id = value; }
35 get { return this.self; }
36 set { this.self = value; }
39 [Nested(ColumnPrefix
= "othername_")]
42 get { return this.other; }
43 set { this.other = value; }
46 #region Public Operations
48 public static void DeleteAll()
50 DeleteAll(typeof(NestedWithPrefix
));
53 public static NestedWithPrefix
[] FindAll()
55 return (NestedWithPrefix
[]) FindAll(typeof(NestedWithPrefix
));
58 public static NestedWithPrefix
Find(int id
)
60 return (NestedWithPrefix
) FindByPrimaryKey(typeof(NestedWithPrefix
), id
);
68 private String first
, last
;
73 get { return this.first; }
74 set { this.first = value; }
80 get { return this.last; }
81 set { this.last = value; }