PostgreSQL · Types · The schema catalog
ArxIdColumn
Definition
- Namespace
ARX.SDK.Services- Package
ARX.SDK
public sealed class ArxIdColumn : IEquatable<ArxIdColumn>A table's id column, declared by the developer: the one column that identifies a record. Every table declares exactly one, or NoIdColumn when it has no id column.
Constructor
No public constructor: create one with:
ArxIdColumn.Generated<T>(string name)An id column the database fills in when the entity has no value for it (identity, sequence, default).
Parameter Type Description namestringThe id column's name. ArxIdColumn.Supplied<T>(string name)An id column the caller always gives a value for.
Parameter Type Description namestringThe id column's name.
Properties
static ArxIdColumn NoIdColumn { get; }The table has no id column: a log or a history table, or a table identified only by a combination of columns, such as a compound primary key (declare those columns as a key). Create stores its rows and returns
None.static ArxIdColumn NoPrimaryKey { get; }Obsolete. Use ArxIdColumn.NoIdColumn: the same declaration under a name that also fits a compound primary key.The former name of
NoIdColumn: it read as wrong for a table with a compound primary key.string Name { get; }The column name (compared with attribute names case-insensitively, like every column). Empty for
NoIdColumn.Type Type { get; }The .NET type the id is read and written as.
bool IsGenerated { get; }True when the database can produce the value.
bool IsNoIdColumn { get; }True for
NoIdColumn.bool IsNoPrimaryKey { get; }Obsolete. Use IsNoIdColumn.The former name of
IsNoIdColumn.bool IsInteger { get; }True when the id is a short, int or long.
Methods
bool Equals(ArxIdColumn? other)Equal when both are
NoIdColumn, or have the same name (ignoring case), type and generated flag.Parameter Type Description otherArxIdColumn?The id column to compare with.
Usage
A line from a verified sample; the full, runnable code is on its page.
.Table("account", ArxIdColumn.Generated<long>("id"))Create one record and get its id, scenario 1
Used in:
- Create one record and get its idCreate
- Create a record that points at another oneCreate
- Catch an error by its codeCreate
- Ids that aren't numbers: text and uuidCreate
- Where to declare: on the entity, or a schema for one call, never bothCreate
- Create without a catalogCreate
- Picklist values checked against the application's catalogCreate
- Load ids and keys from JSON and validate them at startupCreate
- Write to two databases, each with its own serviceCreate
- Use columns named outside the name rule, through aliasesCreate
- Create many records in one call and get their idsCreateMultiple
- Create many records without reading their idsCreateMultiple
- Update one recordUpdate
- Clear a value, keep the othersUpdate
- Catch a record that doesn't existUpdate
- Find rows by id, by key or by columnsUpdate
- Update without a catalogUpdate
- Update many records in one callUpdateMultiple
- Update every row a filter matchesUpdateMultiple
- Delete one recordDelete
- Nothing to delete is not an errorDelete
- Delete by key, by compound key, by columnsDelete
- Delete without a catalogDelete
- Delete many records in one callDeleteMultiple
- Delete every row a filter matchesDeleteMultiple
- Retrieve one recordRetrieve
- Choose the columns to readRetrieve
- Find a record by id, key or columnsRetrieve
- Retrieve many records with a queryRetrieveMultiple
- Page through resultsRetrieveMultiple
- Read a viewRetrieveMultiple
- Views in depth: computed criteria, links both ways, declared ids and lookups, column boundariesRetrieveMultiple
- The sample application
Notes
Generated: the database produces the value when the entity doesn't give one (an identity column, a sequence, a default). A value the entity does give is written. Supplied: the caller always gives the value (a natural id such as a country code or a SKU, a client-generated Guid).