Show / Hide Table of Contents

    Class HierarchyAttribute

    Hierarchy attribute

    Inheritance
    Object
    Attribute
    HierarchyAttribute
    Inherited Members
    Attribute.Equals(Object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, Boolean)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, Boolean)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, Boolean)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, Boolean)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, Boolean)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, Boolean)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, Boolean)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, Boolean)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, Boolean)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, Boolean)
    Attribute.Match(Object)
    Object.Equals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: XData.Mapping
    Assembly: XData.docfx.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public sealed class HierarchyAttribute : Attribute
    Remarks

    Tables can be hierarchically liked to themselves.

    On every hierarchical link is possible to build hierarchy table, to simplify tree structure queries.

    It's alternative of ORACLE CONNECT BY PRIOR...START WITH construction for other database engines

    // Table T_TEST has parent_id field tree linked to test_id (T_TEST's pk)

    // Table L_TEST has two fields parent_id and child_id all linked to T_TEST.test_id

    // Table L_TEST contains all subtree relations inside T_TEST

    // For example: for T_TEST (test_id, parent_id): (1, null) : (2, 1) : (3, 2)

    // L_TEST will contain (parent_id, child_id): (1, 1) : (1, 2) : (1, 3) : (2, 2) : (2, 3) : (3, 3)

    [DataObject("T"),

    DataTable("T_TEST", "T"),

    Hierarchy("T", "L_TEST", "parent_id", "parent_id", "child_id"),

    Column("TestId", "test_id", typeof(long?), "T", Flags = DataPropertyFlag.Id)]

    WARNING! Hierarchy base table (T_TEST in example above) mast contain non complex primary key!

    Hint: Possible to describe multiple hierarchies across one table using different tree links

    Constructors

    | Improve this Doc View Source

    HierarchyAttribute(String, String, String, String, String)

    Hierarchy attribute

    Declaration
    public HierarchyAttribute(string source, string treeTableName, string parent, string linkParent, string linkChild)
    Parameters
    Type Name Description
    String source

    Source table alias

    String treeTableName

    Link table name

    String parent

    Source table parent column name

    String linkParent

    Link table parent column name

    String linkChild

    Link table child column name

    Exceptions
    Type Condition
    XDataRuntimeException

    Source table alias cannot be null or empty string

    XDataRuntimeException

    Link table name cannot be null or empty string

    XDataRuntimeException

    Source table parent column name cannot be null or empty string

    XDataRuntimeException

    Link table parent column name cannot be null or empty string

    XDataRuntimeException

    Link table child column name cannot be null or empty string

    Properties

    | Improve this Doc View Source

    LinkChild

    Link table child column name

    Declaration
    public string LinkChild { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    LinkParent

    Link table parent column name

    Declaration
    public string LinkParent { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Parent

    Source table parent column name

    Declaration
    public string Parent { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Source

    Source table alias

    Declaration
    public string Source { get; }
    Property Value
    Type Description
    String
    See Also
    Alias
    | Improve this Doc View Source

    TreeTableName

    Link table name

    Declaration
    public string TreeTableName { get; }
    Property Value
    Type Description
    String
    Remarks

    Tree table contains links from tree node to all subtree nodes.

    | Improve this Doc View Source

    TypeId

    When implemented in a derived class, gets a unique identifier for this Attribute.

    Declaration
    public override object TypeId { get; }
    Property Value
    Type Description
    Object

    An Object that is a unique identifier for the attribute.

    Overrides
    Attribute.TypeId

    Extension Methods

    SerializationExtensions.ToXml<T>(T)
    CollectionsExtensions.SetValue<TKey, T>(TKey, T)
    CollectionsExtensions.AsEnum<T>(T)
    DataObjectQueryableExtensions.CompareVariable(Object, FilterOperation, String)
    Processing.Do<T>(T, Action<IProcess<T>>[])
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>)
    TypeExtensions.TryConvert<T, TResult>(T, Func<T, TResult>, TResult)
    TypeExtensions.ChangeType<T>(Object)
    TypeExtensions.ChangeType(Object, Type)
    TypeExtensions.InvokeMethod<TRet>(Object, Type[], Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Type[], Expression<Action>, BindingFlags)
    TypeExtensions.InvokeMethod<TRet>(Object, Expression<Func<TRet>>, BindingFlags)
    TypeExtensions.InvokeMethod(Object, Expression<Action>, BindingFlags)
    SqlBlockExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IBlockQueryAdapter, TResult>>)
    QueryDescriptionExtensions.SetExpression<TTag, TResult>(TTag, Expression<Func<IQueryStructureAdapter, TResult>>)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX