Changed to use Authenticate asp.net event instead of Authorize
[castle.git] / ActiveRecord / Castle.ActiveRecord.Framework.Internal.Tests / Model / ClassWithAnyAttribute.cs
blob2e5c57e351e653970f633065536d2434abb17975
1 // Copyright 2004-2007 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.Framework.Internal.Tests.Model
17 using System;
19 using Castle.ActiveRecord;
21 [ActiveRecord]
22 public class BadClassWithAnyAttribute : ActiveRecordBase
24 private int _id = 0;
26 [PrimaryKey(Access = PropertyAccess.NosetterCamelcaseUnderscore)]
27 public int Id
29 get { return _id; }
32 [Any(typeof(long), NotNull = true,
33 TypeColumn = "BILLING_DETAILS_TYPE",
34 IdColumn = "BILLING_DETAILS_ID",
35 Cascade = CascadeEnum.SaveUpdate)]
36 // [Any.MetaValue("CREDIT_CARD", typeof (CreditCard))]
37 [Any.MetaValue("BANK_ACCOUNT", typeof(BankAccount))]
38 public IPayment PaymentMethod
40 get { return null; }
41 set
47 [ActiveRecord]
48 public class ClassWithAnyAttribute : ActiveRecordBase
50 private int _id = 0;
52 [PrimaryKey(Access=PropertyAccess.NosetterCamelcaseUnderscore)]
53 public int Id
55 get { return _id; }
58 [Any(typeof(long), MetaType=typeof(string), NotNull=true,
59 TypeColumn="BILLING_DETAILS_TYPE",
60 IdColumn="BILLING_DETAILS_ID",
61 Cascade=CascadeEnum.SaveUpdate)]
62 [Any.MetaValue("BANK_ACCOUNT", typeof(BankAccount))]
63 public IPayment PaymentMethod
65 get { return null; }
66 set {}
70 [ActiveRecord]
71 public class ClassWithAnyAttributeUsingGenericId : ActiveRecordBase
73 private int _id = 0;
75 [PrimaryKey(Access = PropertyAccess.NosetterCamelcaseUnderscore)]
76 public int Id
78 get { return _id; }
81 [Any(typeof(long?), MetaType = typeof(string), NotNull = true,
82 TypeColumn = "BILLING_DETAILS_TYPE",
83 IdColumn = "BILLING_DETAILS_ID",
84 Cascade = CascadeEnum.SaveUpdate)]
85 [Any.MetaValue("BANK_ACCOUNT", typeof(BankAccount))]
86 public IPayment PaymentMethod
88 get { return null; }
89 set { }
93 public interface IPayment
97 public class CreditCard : IPayment
101 public class BankAccount : IPayment
105 [ActiveRecord]
106 public class ClasssWithHasManyToAny : ActiveRecordBase
108 private int _id = 0;
110 [PrimaryKey(Access = PropertyAccess.NosetterCamelcaseUnderscore)]
111 public int Id
113 get { return _id; }
116 [HasManyToAny(typeof (IPayment), "pay_id", "payments_table", typeof (int), "payment_type", "payment_method_id",
117 MetaType=typeof (int), RelationType=RelationType.Set)]
118 public IPayment PaymentMethod
120 get { return null; }