Skip to main content
Version: 2.7

EntityCollections

Entity collection manages a set of entities (see entity types). The set can be persisted in relational database, like SQLite or MySQL databases. Here, a relational table is created foreach entity collection.

The entity collection contains:

AttributeDescriptionData Type
IdEntity collection idSystem.Guid
NameName of the collection. If no extra table name is specified, the table in the DB receives this name.System.String
EntityTypeNameThe entity type name specifies the C# type name of the entity class.System.String
Properties:TableName[OPT] name of the table in the storageSystem.String

Example showing an entity collection based on a C# class called TMyEntity.

{
"Id": "291BCBF4-3898-4BBF-9461-DB884A77EA30",
"Name": "MyEntityCollection",
"EntityTypeName": "HumanOS.PeMiL.MyImpl.TMyEntity, HumanOS.PeMiL.MyImpl"
}

Fields

A field specifies a property of the entity. Fields are automatically factored from the

Following attributes define an entity field:

AttributeDescriptionData Type
NameName of the FieldSystem.String
DataTypeData type of the fieldSystem.String
IsKeyFlag, if the field is a primary keySystem.Boolean
NonPersistantFlag, if the field is not persisted in the storage.System.Boolean
UniqueFlag, if the field value is uniqueSystem.Boolean

Following field types are possible:

  • System.String as limited or unlimited text length.
    Note for SQLite or MySQL: for string-keys a length must be specified!
  • System.String[]
  • System.Single und System.Single[]
  • System.Double und System.Double[]
  • System.Decimal und System.Decimal[]
  • System.SByte und System.SByte[]
  • System.Int16 und System.Int16[]
  • System.Int32 und System.Int32[]
  • System.Int64 und System.Int64[]
  • System.Byte und System.Byte[]
  • System.UInt16 und System.UInt16[]
  • System.UInt32 und System.UInt32[]
  • System.UInt64 und System.UInt64[]
  • System.Boolean und System.Boolean[]
  • System.Char und System.Char[]
  • System.DateTime und System.DateTime[]
  • System.Guid und System.Guid[]

Readonly View Collections

The readonly view is a special entity collection that joins multiple entity collection as sources to get a view on top. In classical SQL databases this type create a DB View.

AttributeDescriptionData Type
IdEntity collection idSystem.Guid
NameName of the collection. If no extra table name is specified, the table in the DB receives this name.System.String
EntityTypeNameThe entity type name specifies the C# type name of the entity class.System.String
TypeCollection type is "ReadOnlyView"EEntityCollectionType
MasterCollectionIdId of the master collection.System.Guid
Properties:TableName[OPT] name of the table in the storageSystem.String

Example:

{
"Id": "291BCBF4-3898-4BBF-9461-DB884A77EA30",
"Name": "MyEntityCollection",
"EntityTypeName": "HumanOS.PeMiL.MyImpl.TMyViewEntity, HumanOS.PeMiL.MyImpl",
"Type": "ReadOnlyView",
"MasterCollectionId" : "C9FFEE4C-2320-49B7-879C-D71605315BE0"
}

The dependencies and joins are defined in the C# class (here TMyViewEntity). Check [HumanOS SDK Manual] for further information.