Class TableInfo
Base class for typed table information classes. Each typed subclass represents a table; each instance of a subclass represents one instance of a table in a query (multiple instances are automatically assigned unique correlation identifiers in the generated SQL, and must be explicitly joined to avoid a colossal cross product).
Typed subclasses for each known table are available through the TablesInfo class and its various static factory methods. Typed table info instances are also available from Rows and Entities objects and their corresponding CustomSearch nested classes.Inheritance
Implements
Inherited Members
Namespace: SuperOffice.Data.SQL
Assembly: SoDataBase.dll
Syntax
public abstract class TableInfo : ICloneable
Constructors
TableInfo(string)
Constructor for class TableInfo
Declaration
public TableInfo(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The conceptual name of the table in the database. |
Properties
All
A collection of all the fields in the table, where the first is the primary key.
Declaration
public virtual FieldInfo[] All { get; }
Property Value
| Type | Description |
|---|---|
| FieldInfo[] |
DbName
Name of the table in the database
Declaration
public string DbName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Definition
Get definition
Declaration
public virtual SoTable Definition { get; }
Property Value
| Type | Description |
|---|---|
| SoTable |
HashCheckFields
Get an enumeration of all fields involved in hash checks, either as source or as the checksum
Declaration
public IEnumerable<FieldInfo> HashCheckFields { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<FieldInfo> |
IsDictionaryTable
Get IsDictionaryTable
Declaration
public bool IsDictionaryTable { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[string]
Find field by name - this is an efficient lookup
Declaration
public FieldInfo this[string name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Property Value
| Type | Description |
|---|---|
| FieldInfo |
PrimaryKeyField
Returns a reference to the primarykey FieldInfo object in the tableinfo
Declaration
public Int32FieldInfo PrimaryKeyField { get; }
Property Value
| Type | Description |
|---|---|
| Int32FieldInfo |
ProtAll
Base class for typed table information classes. Each typed subclass represents a table; each instance of a subclass represents one instance of a table in a query (multiple instances are automatically assigned unique correlation identifiers in the generated SQL, and must be explicitly joined to avoid a colossal cross product).
Typed subclasses for each known table are available through the TablesInfo class and its various static factory methods. Typed table info instances are also available from Rows and Entities objects and their corresponding CustomSearch nested classes.Declaration
protected FieldInfo[] ProtAll { get; }
Property Value
| Type | Description |
|---|---|
| FieldInfo[] |
TableName
The conceptual name of the table
Declaration
public string TableName { get; }
Property Value
| Type | Description |
|---|---|
| string |
UseNolockIfPossible
Request that this table should be used with the least possible amount of locking in the query.
This may result in "dirty" reads, i.e., you read uncommited changes.
Declaration
public bool UseNolockIfPossible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Clone()
Clone a table info object, via the create-from-type factory method
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| object | Clone of self, as object |
FieldInfoFromSoField(SoField)
Base class for typed table information classes. Each typed subclass represents a table; each instance of a subclass represents one instance of a table in a query (multiple instances are automatically assigned unique correlation identifiers in the generated SQL, and must be explicitly joined to avoid a colossal cross product).
Typed subclasses for each known table are available through the TablesInfo class and its various static factory methods. Typed table info instances are also available from Rows and Entities objects and their corresponding CustomSearch nested classes.Declaration
protected FieldInfo FieldInfoFromSoField(SoField defField)
Parameters
| Type | Name | Description |
|---|---|---|
| SoField | defField |
Returns
| Type | Description |
|---|---|
| FieldInfo |
FindField(string)
Returns a field-info using a case-insensitive search on the field name.
Declaration
public virtual FieldInfo FindField(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
Returns
| Type | Description |
|---|---|
| FieldInfo |
Remarks
Does a linear search across the All array. Could be speeded up.
IsSameTable(TableInfo)
Check if this table is the same (dictionary-wise) as the incoming table
Declaration
public bool IsSameTable(TableInfo rightHand)
Parameters
| Type | Name | Description |
|---|---|---|
| TableInfo | rightHand | Table to compare with |
Returns
| Type | Description |
|---|---|
| bool | true if both tables represent the same table in the dictionary |
Remarks
For better performance, comparison of table numbers is used if possible; otherwise a name match is attempted.
RegisterFields(params FieldInfo[])
Base class for typed table information classes. Each typed subclass represents a table; each instance of a subclass represents one instance of a table in a query (multiple instances are automatically assigned unique correlation identifiers in the generated SQL, and must be explicitly joined to avoid a colossal cross product).
Typed subclasses for each known table are available through the TablesInfo class and its various static factory methods. Typed table info instances are also available from Rows and Entities objects and their corresponding CustomSearch nested classes.Declaration
protected void RegisterFields(params FieldInfo[] fields)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo[] | fields |
ToString()
Return just the NetServer table name as the debug string
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |