Constructor
new UBDomain(domainInfo)
Arguments:
-
domainInfo
(Object)
 getDomainInfo UB server method resultProperties
-
domain
(Object)
 raw entities collection -
entityMethods
(Object)
 entities methods access rights for current user -
models
(Object)
 information about domain models -
i18n
(Object)
 entities localization to current user language -
forceMIMEConvertors
(Object)
 list of registered server-side MIME converters for document type attribute content
-
Members
entities: Object.<String, UBEntity>
Hash of entities. Keys is entity name, value is UBEntity
connections: Array.<DBConnectionConfig>
Connection collection (for extended domain info only).
models: Object.<String, UBModel>
Models collection
forceMIMEConvertors: Object
readonly
ubDataTypes
static
readonly
UnityBase base attribute data types
Properties:
Name | Type | Description |
---|---|---|
String |
Small string. MSSQL: NVARCHAR, ORACLE: NVARCHAR2, POSTGRE: VARCHAR | |
Int |
32-bite Integer. MSSQL: INT, ORACLE: INTEGER, POSTGRE: INTEGER | |
BigInt |
64-bite Integer. MSSQL: BIGINT, ORACLE: NUMBER(19), POSTGRE: BIGINT | |
Float |
Double. MSSQL: FLOAT, ORACLE: NUMBER(19, 4), POSTGRE: NUMERIC(19, 4) | |
Currency |
Currency. MSSQL: FLOAT, ORACLE: NUMBER(19, 2), POSTGRE: NUMERIC(19, 2) | |
Boolean |
Boolean. MSSQL: TINYINT, ORACLE: NUMBER(1), POSTGRE: SMALLINT | |
DateTime |
Date + Time in UTC (GMT+0) timezone. MSSQL: DATETIME, OARCLE: DATE, POSTGRE: TIMESTAMP WITH TIME ZONE | |
Text |
Long strint. MSSQL: NVARCHAR(MAX), ORACLE: CLOB, POSTGRE: TEXT | |
ID |
Alias for BigInt | |
Entity |
Reference to enother entity. BigInt | |
Document |
Store a JSON with information about Document place in blob store | |
Many |
||
TimeLog |
Seconds since UNIX epoch, Int64. MSSQL: BIGINT, ORACLE: NUMBER(19), POSTGRE: BIGINT | |
Enum |
Enumertion (see ubm_enum) | |
BLOB |
Bynary data. MSSQL: VARBINARY(MAX), ORACLE: BLOB, POSTGRE: BYTEA | |
Date |
Date (without time) in UTC (GMT+0) |
ExpressionType static readonly
Types of expressions in attribute mapping
Properties:
Name | Type | Description |
---|---|---|
Field |
||
Expression |
ubMixins static readonly
UnityBase base mixins
Properties:
Name | Type | Description |
---|---|---|
dataHistory |
||
mStorage |
||
unity |
||
treePath |
ubServiceFields static readonly
Service attribute names
Properties:
Name | Type | Description |
---|---|---|
dateFrom |
||
dateTo |
EntityDataSourceType: String static readonly
Entity dataSource types
Properties:
Name | Type | Description |
---|---|---|
Normal |
String | |
External |
String | |
System |
String | |
Virtual |
String |
EntityCacheTypes static
Properties:
Name | Type | Description |
---|---|---|
None |
||
Entity |
||
Session |
||
SessionEntity |
dialectsPriority static
Priority to apply a mapping of a attributes/entities to the physical tables depending of connection dialect
Methods
isEntityMethodsAccessible(entityCode, methodNames)
Check all provided entity methods are accessible via RLS.
If entity does not exist in domain or at last one of provided methods is not accessible - return false
Arguments:
get(entityCode, raiseErrorIfNotExistsopt) → UBEntity
Get entity by code
Arguments:
-
entityCode
(String)
-
[raiseErrorIfNotExists=true]
(Boolean)
 If true
(default) and entity does not exists throw error
has(entityCode) → Boolean
Check entity present in domain & user has access right for at least one entity method
Arguments:
-
entityCode
(String)
eachEntity(callBack)
Iterates over domain entities and invokes callBack
for each entity.
The iteratee is invoked with three arguments: (UBEntity, entityName, UBDomain.entities)
Arguments:
-
callBack
(function)
filterEntities(config) → Array
Filter entities by properties
Arguments:
Example
// sessionCachedEntites contains all entities with property cacheType equal Session
var sessionCachedEntites = domain.filterEntities({cacheType: 'Session'});
getPhysicalDataType(dataType) → String
static
Return physical type by UBDataType
Arguments:
-
dataType
(String)
If entity does not exist in domain or at last one of provided methods is not accessible - return false
entityCode
(String)
[raiseErrorIfNotExists=true]
(Boolean)
 If true
(default) and entity does not exists throw error
entityCode
(String)
callBack
for each entity.
The iteratee is invoked with three arguments: (UBEntity, entityName, UBDomain.entities)
callBack
(function)
// sessionCachedEntites contains all entities with property cacheType equal Session
var sessionCachedEntites = domain.filterEntities({cacheType: 'Session'});
dataType
(String)