DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
UserType.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System;
18 
19 using Deveel.Data.Sql;
20 
21 namespace Deveel.Data.Types {
22  public sealed class UserType : SqlType, IDbObject {
23  public UserType(UserTypeInfo typeInfo)
24  : base(typeInfo.TypeName.FullName, SqlTypeCode.Type) {
25  if (typeInfo == null)
26  throw new ArgumentNullException("typeInfo");
27 
28  TypeInfo = typeInfo;
29  }
30 
31  public UserTypeInfo TypeInfo { get; private set; }
32 
33  public ObjectName FullName {
34  get { return TypeInfo.TypeName; }
35  }
36 
37  public override bool IsStorable {
38  get { return true; }
39  }
40 
42  get { return DbObjectType.Type; }
43  }
44 
45  public override bool IsComparable(SqlType type) {
46  // For the moment not possible to compare
47  return false;
48  }
49 
50  public override bool CanCastTo(SqlType destType) {
51  return false;
52  }
53 
54  public override bool IsIndexable {
55  get { return false; }
56  }
57  }
58 }
override bool IsComparable(SqlType type)
Verifies if a given SqlType is comparable to this data-type.
Definition: UserType.cs:45
Represents a database object, such as a table, a trigger, a type or a column.
Definition: IDbObject.cs:24
Describes the name of an object within a database.
Definition: ObjectName.cs:44
UserType(UserTypeInfo typeInfo)
Definition: UserType.cs:23
A user-defined TYPE that holds complex objects in a database column.
DbObjectType ObjectType
Gets the type of database object that the implementation is for
Definition: IDbObject.cs:35
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
override bool CanCastTo(SqlType destType)
Verifies if this type can cast any value to the given SqlType.
Definition: UserType.cs:50
DbObjectType
The kind of objects that can be handled by a database system and its managers
Definition: DbObjectType.cs:27