DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
ColumnAttribute.cs
Go to the documentation of this file.
1 using System;
2 
3 using Deveel.Data.Sql;
4 using Deveel.Data.Types;
5 
6 namespace Deveel.Data.Mapping {
7  [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
8  public sealed class ColumnAttribute : Attribute {
9  public ColumnAttribute(string name, SqlTypeCode type, int size, int scale) {
10  ColumnName = name;
11  SqlType = type;
12  Size = size;
13  Scale = scale;
14  }
15 
16  public ColumnAttribute(string name, SqlTypeCode type, int size)
17  : this(name, type, size, -1) {
18  }
19 
20  public ColumnAttribute(string name, SqlTypeCode type)
21  : this(name, type, -1) {
22  }
23 
24  public ColumnAttribute(string name)
25  : this(name, SqlTypeCode.Unknown) {
26  }
27 
28  public ColumnAttribute(SqlTypeCode type, int size, int scale)
29  : this(null, type, size, scale) {
30  }
31 
32  public ColumnAttribute(SqlTypeCode type, int size)
33  : this(type, size, -1) {
34  }
35 
37  : this(type, -1) {
38  }
39 
40  public ColumnAttribute(int size, int scale)
41  : this(null, SqlTypeCode.Unknown, size, scale) {
42  }
43 
44  public ColumnAttribute(int size)
45  : this(size, -1) {
46  }
47 
48  public ColumnAttribute()
49  : this(null, SqlTypeCode.Unknown, -1, -1) {
50  }
51 
52  public string ColumnName { get; set; }
53 
54  public SqlTypeCode SqlType { get; set; }
55 
56  public int Size { get; set; }
57 
58  public int Scale { get; set; }
59  }
60 }
ColumnAttribute(string name, SqlTypeCode type, int size)
ColumnAttribute(SqlTypeCode type, int size)
ColumnAttribute(string name, SqlTypeCode type, int size, int scale)
ColumnAttribute(int size, int scale)
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
SqlTypeCode
Enumerates the codes of all SQL types handled by the system.
Definition: SqlTypeCode.cs:23
ColumnAttribute(SqlTypeCode type, int size, int scale)
ColumnAttribute(string name, SqlTypeCode type)