Class EntityImportColDefinition
This is the base class that defines a property against an entity that can be imported/exported
This commonly holds the property information of the same property on the entity, and for relationship properties will have child definitions holding the key properties to uniquely identify that entity relationship
They can also contain custom properties that do not exist on the entity if you are providing custom sql instead of the table for the entity. That can be done via EntityDescriptorTemplateExtenderInheritance
Inherited Members
Namespace: LemonEdge.API.Descriptors
Assembly: LemonEdge.API.dll
Syntax
public abstract class EntityImportColDefinition : BaseHasChildren<EntityImportColDefinition>, IHasChildren<EntityImportColDefinition>, IHasChildren, IQueryableFieldInfo
Remarks
This also implements IQueryableFieldInfo as this holds the information for how the query tool can interact with this property from sql
Constructors
EntityImportColDefinition(bool, EntityImportColDefinition)
Creates a new entity import column definition with the specified properties
Declaration
public EntityImportColDefinition(bool isDirectSQLProp, EntityImportColDefinition parent = null)
Parameters
Type | Name | Description |
---|---|---|
bool | isDirectSQLProp | Indicates this property can be included in a sql select from query tools |
EntityImportColDefinition | parent | Holds a parent entity import column definition if this one is a child, typically for columns that hold key descriptions for relationship properties |
Properties
ColumnInfo
Holds the column info definition for this property.
Declaration
public abstract ColumnDescriptor ColumnInfo { get; }
Property Value
Type | Description |
---|---|
ColumnDescriptor |
ColumnMnemonic
The unique mnemonic for this column within the entity.
Unlike property name this is unique throughout the entities entity import column definitions. So if you have a property named Name, and a property relationship called CurrencyID, you could have the following definitions:
[PropertyName: Name, ColumnMnemonic: Name] [PropertyName: IndustryID, ColumnMnemonic: IndustryID] [PropertyName: Name, ColumnMnemonic: IndustryID_Name]Declaration
public abstract string ColumnMnemonic { get; }
Property Value
Type | Description |
---|---|
string |
ColumnName
The actual name of this field in sql. Typically the name of a column in a table or function
By default for an entity property this is ColumnName property of ColumnInfo
Declaration
public string ColumnName { get; }
Property Value
Type | Description |
---|---|
string |
ColumnType
The type for this column. Used for formatting and parsing string representations of the value correctly
Declaration
public abstract Type ColumnType { get; }
Property Value
Type | Description |
---|---|
Type |
ExampleTemplateValue
The example value to use for this property when it is being exported to an example file for the template.
This can list possible value options, etc to make importing more understandable to the user
Declaration
public string ExampleTemplateValue { get; set; }
Property Value
Type | Description |
---|---|
string |
FieldMapToDescriptorColumnName
The column name this field is a property of in the LemonEdge platform. Used as an optional mapping if this field is actual data from the system.
Not required, but provides useful contextual information for the query tools to know how to join items, display, and/or open them
Declaration
public virtual string FieldMapToDescriptorColumnName { get; }
Property Value
Type | Description |
---|---|
string |
FieldMapToDescriptorSubTypeID
The unique global id of the sub type (replicated entity descriptor) this field is a property of in the LemonEdge platform. Used as an optional mapping if this field is actual data from the system.
Not required, but provides useful contextual information for the query tools to know how to join items, display, and/or open them
Declaration
public virtual Guid? FieldMapToDescriptorSubTypeID { get; }
Property Value
Type | Description |
---|---|
Guid? |
FieldMapToDescriptorTypeID
The unique global id of the type this field is a property of in the LemonEdge platform. Used as an optional mapping if this field is actual data from the system.
Not required, but provides useful contextual information for the query tools to know how to join items, display, and/or open them
Declaration
public virtual Guid? FieldMapToDescriptorTypeID { get; }
Property Value
Type | Description |
---|---|
Guid? |
IsCoreProp
Indicates this is a core base property from IsBasePropertyName(string).
Core properties can not be imported, they are used by the system and can not be changed during imports
Declaration
public virtual bool IsCoreProp { get; }
Property Value
Type | Description |
---|---|
bool |
IsCustomAction
Indicates this column does not actually hold any data, rather can be used to perform custom actions/processes during an import
This can be enabled through implementing EntityDescriptorTemplateExtender
Declaration
public virtual bool IsCustomAction { get; }
Property Value
Type | Description |
---|---|
bool |
IsCustomDataSource
Indicates this column is not actually part of the entity, but is associated with it by third party data source ids from IDataSourceType
Declaration
public virtual bool IsCustomDataSource { get; }
Property Value
Type | Description |
---|---|
bool |
IsExtendedProperty
Indicates if this is a property tha comes from another entity descriptor
Declaration
public virtual bool IsExtendedProperty { get; }
Property Value
Type | Description |
---|---|
bool |
IsImportAction
Indicates this column is the system one (ImportActionPropertyName) that is used to indicate what type of action should be taken with this data when importing this line (none, import, or delete)
Declaration
public virtual bool IsImportAction { get; }
Property Value
Type | Description |
---|---|
bool |
IsImportDataType
Indicates this column is the system one (ImportDataType) that is used to indicate what type of data is being imported
Declaration
public virtual bool IsImportDataType { get; }
Property Value
Type | Description |
---|---|
bool |
IsInheritingType
Indicates this property is not against the given entity, but is inherited from a parent entity.
This way the system knows to generate sql going to the parent entity table rather than looking for it against this table which would not exist
Declaration
public virtual bool IsInheritingType { get; }
Property Value
Type | Description |
---|---|
bool |
IsKey
Indicates if this definition is part of a key for the entity.
If so it is used for checking if the item exists in the database first before updating/inserting
Declaration
public virtual bool IsKey { get; }
Property Value
Type | Description |
---|---|
bool |
IsKeyLink
Indicates this column holds the relationship key part of a top level key
Declaration
public virtual bool IsKeyLink { get; }
Property Value
Type | Description |
---|---|
bool |
IsSQLProp
Indicates this property can be included in a sql select from query tools
Declaration
public bool IsSQLProp { get; }
Property Value
Type | Description |
---|---|
bool |
PivotHeaderItem
If this property holds a definition coming from a pivoted property from a sub entity, then this holds the item that represents the header for this column
Declaration
public virtual IBaseEntity PivotHeaderItem { get; }
Property Value
Type | Description |
---|---|
IBaseEntity |
PropertyName
The name of the property
Declaration
public virtual string PropertyName { get; }
Property Value
Type | Description |
---|---|
string |
Relationship
If this property holds a definition coming from a pivoted property from a sub entity, then this holds the relationship to the pivot items
Declaration
public virtual EntityRelationship Relationship { get; }
Property Value
Type | Description |
---|---|
EntityRelationship |
UniqueKey
The unique key for this field within the IQueryableItem.
By default for an entity property this is the ColumnName
Declaration
public string UniqueKey { get; }
Property Value
Type | Description |
---|---|
string |
UserFriendlyName
A user friendly name of this column
Declaration
public abstract string UserFriendlyName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
FormatStringValueAsSQL(string)
Given a user entered string representing a value for this field, this function translates that to appropriately formatted sql
Declaration
public string FormatStringValueAsSQL(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string representation of a value for this field |
Returns
Type | Description |
---|---|
string | An appropriately formatted sql representation of the specified |
SetDefaultValueToEnumOptions(Type)
Sets the ExampleTemplateValue for this property when being exported to a dummy excel example file, to be the formatted list of all enum values
Declaration
protected void SetDefaultValueToEnumOptions(Type enumType)
Parameters
Type | Name | Description |
---|---|---|
Type | enumType | The enum to list all values for the default value string |
SetDefaultValueToEnumOptions<T>()
Sets the ExampleTemplateValue for this property (used when being exported to a dummy excel example file) to be the formatted list of all enum values
Declaration
public void SetDefaultValueToEnumOptions<T>() where T : Enum
Type Parameters
Name | Description |
---|---|
T | The type of enum to enumerate and list all of its values for in the ExampleTemplateValue property |
UpdateColumn(string, string, ISQLTypeWrapper)
Given an ISQLTypeWrapper to represent this field in a user created
IDataset query, thi functions updates the column
to store all the
correct values to represent the schema of this field in sql
Declaration
public virtual void UpdateColumn(string queryableItemID, string queryableItemSubID, ISQLTypeWrapper column)
Parameters
Type | Name | Description |
---|---|---|
string | queryableItemID | The id of the IQueryableItem this field is a member of within the query |
string | queryableItemSubID | |
ISQLTypeWrapper | column | The column for this dataset that should be updated to represent the schema for this field |