Removed untyped contructor from ComponentRegistration and add a protected setter.
[castle.git] / ActiveRecord / Castle.ActiveRecord / Attributes / HqlNamedQueryAttribute.cs
blob78f1d4248a1eff7c82f113c3b282e89e7ebf4315
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
17 using System;
19 /// <summary>
20 /// This is used to define a named HQL query.
21 /// It represents the &lt;query&gt; element.
22 /// </summary>
23 /// <example>
24 /// [assembly: HqlNamedQuery("allAdultUsers", "from User where user.Age > 21")]
25 /// </example>
26 [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true), Serializable]
27 public class HqlNamedQueryAttribute : Attribute
29 private string name;
30 private string query;
32 /// <summary>
33 /// The name of the query
34 /// </summary>
35 public string Name
37 get { return name; }
40 /// <summary>
41 /// The query itself
42 /// </summary>
43 public string Query
45 get { return query; }
48 /// <summary>
49 /// Create a new instance
50 /// </summary>
51 public HqlNamedQueryAttribute(string name, string query)
53 this.name = name;
54 this.query = query;