DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
|
Defines the properties of a specific SQL Type and handles the values compatible. More...
Static Public Member Functions | |
static SqlType | Parse (string s) |
Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More... | |
static SqlType | Parse (IContext context, string s) |
Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent. More... | |
static bool | IsPrimitiveType (SqlTypeCode typeCode) |
static SqlType | Resolve (SqlTypeCode typeCode) |
static SqlType | Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta) |
static SqlType | Resolve (SqlTypeCode typeCode, DataTypeMeta[] meta, ITypeResolver resolver) |
static SqlType | Resolve (SqlTypeCode typeCode, string name) |
static SqlType | Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta) |
static SqlType | Resolve (string name) |
static SqlType | Resolve (string name, DataTypeMeta[] meta) |
static SqlType | Resolve (string name, DataTypeMeta[] meta, ITypeResolver resolver) |
static SqlType | Resolve (SqlTypeCode typeCode, string name, DataTypeMeta[] meta, ITypeResolver resolver) |
Protected Member Functions | |
SqlType (SqlTypeCode sqlType) | |
Constructs the SqlType for the given specific SQL TYPE. More... | |
SqlType (string name, SqlTypeCode typeCode) | |
Constructs the SqlType for the given specific SQL TYPE and a given name. More... | |
SqlType (ObjectData data) | |
virtual void | GetData (SerializeData data) |
Package Functions | |
virtual int | GetCacheUsage (ISqlObject value) |
virtual int | ColumnSizeOf (ISqlObject obj) |
Properties | |
string | Name [get, private set] |
Gets the name of the data-type that is used to resolve it within the context. More... | |
SqlTypeCode | TypeCode [get, private set] |
Gets the kind of SQL type this data-type handles. More... | |
virtual bool | IsIndexable [get] |
Indicates if the values handled by the type can be part of an index. More... | |
bool | IsPrimitive [get] |
Gets a value indicating if this data-type is primitive. More... | |
bool | IsNull [get] |
virtual bool | IsStorable [get] |
Private Member Functions | |
void ISerializable. | GetData (SerializeData data) |
Static Private Member Functions | |
static SqlTypeCode | ResolveTypeCode (string name) |
Defines the properties of a specific SQL Type and handles the values compatible.
Definition at line 33 of file SqlType.cs.
|
inlineprotected |
Constructs the SqlType for the given specific SQL TYPE.
This constructor will set the Name value to the equivalent of the SQL Type specified.
sqlType | The code of the SQL Type this object will represent. |
Definition at line 43 of file SqlType.cs.
|
inlineprotected |
Constructs the SqlType for the given specific SQL TYPE and a given name.
name | |
typeCode |
Definition at line 53 of file SqlType.cs.
|
inlineprotected |
Definition at line 58 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.StringType.
Definition at line 192 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.BooleanType.
Definition at line 258 of file SqlType.cs.
|
inlinevirtual |
Verifies if this type can cast any value to the given SqlType.
destType | The other type, destination of the cast, to verify. |
By default, this method returns false
, because cast process must be specified per type: when overriding the method CastTo, pay attention to also override this method accordingly.
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.NumericType, Deveel.Data.Types.DateType, Deveel.Data.Types.BooleanType, Deveel.Data.Types.UserType, and Deveel.Data.Xml.XmlNodeType.
Definition at line 153 of file SqlType.cs.
|
inlinevirtual |
Converts the given object value to a SqlType specified.
value | The value to convert. |
destType | The destination type of the conversion. |
If the given destType destination type is equivalent to this type, it will return the value provided, otherwise it will throw an exception by default.
Casting values to specific types is specific to each data-type: override this method to support type-specific conversions.
When overriding this method, CanCastTo should be overridden accordingly to indicate the type supports casting.
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.NumericType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.BooleanType, and Deveel.Data.Xml.XmlNodeType.
Definition at line 180 of file SqlType.cs.
|
inlinepackagevirtual |
Reimplemented in Deveel.Data.Types.NumericType, Deveel.Data.Types.StringType, Deveel.Data.Types.DateType, Deveel.Data.Types.BooleanType, and Deveel.Data.Types.BinaryType.
Definition at line 416 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.NumericType, Deveel.Data.Routines.Function.DynamicSqlType, and Deveel.Data.Types.BooleanType.
Definition at line 358 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, Deveel.Data.Types.StringType, Deveel.Data.Types.NullType, and Deveel.Data.Xml.XmlNodeType.
Definition at line 188 of file SqlType.cs.
|
inlinevirtual |
Definition at line 437 of file SqlType.cs.
|
inlinevirtual |
Definition at line 429 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, Deveel.Data.Types.StringType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.BooleanType, Deveel.Data.Types.IntervalType, Deveel.Data.Types.NullType, Deveel.Data.Types.QueryType, and Deveel.Data.Xml.XmlNodeType.
Definition at line 404 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 204 of file SqlType.cs.
|
inline |
Definition at line 373 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.StringType.
Definition at line 387 of file SqlType.cs.
|
inlinepackagevirtual |
Definition at line 412 of file SqlType.cs.
|
inlineprivate |
Implements Deveel.Data.Serialization.ISerializable.
Definition at line 278 of file SqlType.cs.
|
inlineprotectedvirtual |
Implements Deveel.Data.Serialization.ISerializable.
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.BinaryType, and Deveel.Data.Types.NumericType.
Definition at line 283 of file SqlType.cs.
|
inline |
Definition at line 382 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.NumericType, Deveel.Data.Types.IntervalType, Deveel.Data.Types.BooleanType, and Deveel.Data.Types.ArrayType.
Definition at line 425 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.NumericType, Deveel.Data.Types.BooleanType, Deveel.Data.Types.IntervalType, and Deveel.Data.Types.ArrayType.
Definition at line 421 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.StringType, Deveel.Data.Types.NumericType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.BooleanType, and Deveel.Data.Types.IntervalType.
Definition at line 408 of file SqlType.cs.
|
inlinevirtual |
Verifies if a given SqlType is comparable to this data-type.
type | The other data-type to verify the compatibility. |
It is not required two SqlType to be identical to be compared: when overridden by a derived class, this methods verifies the properties of the argument type, to see if values handled by the types can be compared.
By default, this method compares the values returned by TypeCode to see if they are identical.
true
if the values handled by this data-type can be compared to ones handled by the given type , or false
otherwise. Reimplemented in Deveel.Data.Types.NumericType, Deveel.Data.Types.StringType, Deveel.Data.Routines.Function.DynamicSqlType, Deveel.Data.Types.DateType, Deveel.Data.Types.BooleanType, Deveel.Data.Types.IntervalType, Deveel.Data.Types.UserType, and Deveel.Data.Spatial.SpatialType.
Definition at line 137 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 216 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 244 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 230 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 223 of file SqlType.cs.
|
inlinestatic |
Definition at line 433 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 251 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 237 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 208 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 200 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.BooleanType.
Definition at line 212 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.BooleanType.
Definition at line 262 of file SqlType.cs.
|
inlinestatic |
Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent.
s | The SQL formatted data-type string, defining the properties of the type. |
This method only supports primitive types.
Definition at line 321 of file SqlType.cs.
Parses a SQL formatted string that defines a data-type into a constructed SqlType object equivalent.
query | |
s | The SQL formatted data-type string, defining the properties of the type. |
This method only supports primitive types.
Definition at line 338 of file SqlType.cs.
|
inlinestatic |
Definition at line 441 of file SqlType.cs.
|
inlinestatic |
Definition at line 445 of file SqlType.cs.
|
inlinestatic |
Definition at line 449 of file SqlType.cs.
|
inlinestatic |
Definition at line 453 of file SqlType.cs.
|
inlinestatic |
Definition at line 457 of file SqlType.cs.
|
inlinestatic |
Definition at line 461 of file SqlType.cs.
|
inlinestatic |
Definition at line 465 of file SqlType.cs.
|
inlinestatic |
Definition at line 469 of file SqlType.cs.
|
inlinestatic |
Definition at line 474 of file SqlType.cs.
|
inlinestaticprivate |
Definition at line 478 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.BooleanType.
Definition at line 274 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, Deveel.Data.Types.StringType, Deveel.Data.Types.DateType, Deveel.Data.Types.BinaryType, Deveel.Data.Types.BooleanType, Deveel.Data.Types.IntervalType, Deveel.Data.Types.QueryType, Deveel.Data.Types.NullType, and Deveel.Data.Xml.XmlNodeType.
Definition at line 399 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 196 of file SqlType.cs.
|
inline |
Definition at line 395 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 270 of file SqlType.cs.
Gets the one data-type between this and the other one given that handles the wider range of values.
otherType | The other type to verify. |
This is very important for operations and functions, when operating on objects with comparable but different data-types, to ensure the result of the operation will be capable to handle the final value.
By default, this method returns this instance, as it is not able to dynamically define the wider type.
Reimplemented in Deveel.Data.Types.NumericType.
Definition at line 305 of file SqlType.cs.
|
inlinevirtual |
Reimplemented in Deveel.Data.Types.NumericType, and Deveel.Data.Types.BooleanType.
Definition at line 266 of file SqlType.cs.
|
get |
Indicates if the values handled by the type can be part of an index.
By default, this returns true
, since most of primitive types are indexable (except for Long Objects).
Definition at line 100 of file SqlType.cs.
|
get |
Definition at line 111 of file SqlType.cs.
|
get |
Gets a value indicating if this data-type is primitive.
Definition at line 107 of file SqlType.cs.
|
get |
Definition at line 115 of file SqlType.cs.
|
getprivate set |
Gets the name of the data-type that is used to resolve it within the context.
This value is always unique within a database system and can be simple (eg. for primitive types like NUMERIC
), or composed by multiple parts (eg. for user-defined types).
Some primitive types (for example NUMERIC
) can handle multiple SQL types, so this property works as an identificator for the type handler.
Definition at line 75 of file SqlType.cs.
|
getprivate set |
Gets the kind of SQL type this data-type handles.
The same instance of a SqlType can handle multiple kind of SQL types, making such instances, of the same kind, to be different in attributes.
In fact, for example a NUMERIC
data-type materialized as INTEGER
is not equal to NUMERIC
data-type materialized as BIGINT
: the two instances will be comparable, but they won't be considered coincident.
Definition at line 91 of file SqlType.cs.