orm_doc.js | |
---|---|
@json An ORM is an Object Relational Mapping that defines the relationship between object oriented type In the xTuple PostgreSQL implmentation the installation of ORM files triggers views to be created Object Name Datbase Name ORMs are specifically designed to be extensible so that a database table can be virtually expanded The initial ORM is referred to as the "base" ORM. Additional ORMs can be defined against the Extensions can be created as both completely independent ORM definitions or added to an | { |
A container identifier that correlates with an object name space. Required. | "nameSpace": "XM", |
A specific type name that correlates with an object type. Required. | "type": "ProjectTask", |
Context is a sub container for name space that allows extending the same Required. | "context": "xtuple", |
The source table or view from which you are drawing data. Schema qualifications Required. | "table": "prjtask", |
Table name that specifies which table controls the versioning information Optional. | "lockTable": "prjtask", |
Indicates this ORM is an extension to another ORM. A join will be created between | "isExtension": false, |
This value only applies to extensions and indicates the query should perform a join | "isChild": false, |
The table sequence to use when generating the next unique record id. Necessary | "idSequenceName": "prjtask_prjtask_id_seq", |
Text describing the purpose of the ORM which will be appended to the associated | "comment": "Project Task Map", |
Designates that data for this type can only be accessed in the context of a parent. Any attempts | "isNestedOnly": false, |
Used to describe document access. If absent no access will be granted to this type. Required. | "privileges": { |
Describes privileges that allow a user to have access to all records of this Required. | "all": { |
The create privilege for this object. @type {String} | "create": "MaintainAllProjects", |
The read privilege for this object. @type {String} | "read": "ViewAllProjects", |
The update privilege for this object. This @type {String} | "update": "MaintainAllProjects", |
The delete privilege for this object.
| "delete": "MaintainAllProjects"
}, |
Describes privileges that allow a user to have access only to specific records | "personal": { |
The personal create privilege for this object. @type {String} | "create": "MaintainPersonalProjects", |
The personal read privilege for this object. @type {String} | "read": "ViewPersonalProjects", |
The personal update privilege for this object. This privilege also implicitly @type {String} | "update": "MaintainPersonalProjects", |
The personal delete privilege for this object. @type {String} | "delete": "MaintainPersonalProjects", |
An array properties on the object on which to compare the logged in user @type {Array} | "properties": [
"owner",
"assignedTo",
"projectOwner",
"projectAssignedTo"
]
}, |
Attribute level privileges. Each attribute that has privilege control should be listed | "attribute": {
"owner": {
"edit": "editOwner"
},
"cost": {
"view": "viewCosts maintainCosts"
}
}
}, |
The array of client object properties that maps to table columns. Each hash listed Required. | "properties": [
{ |
The property name. Required. @type {String} | "name": "task", |
Indicates this property is an attribute that maps directly to table column. @type {Hash} | "attr": { |
The expected type of the property. Should be any of the following: @type {String} | "type": "Number", |
The mapped database column associated with this property. There is support for a special case where if the column name is @type {String} | "column": "prjtask_id", |
Indicates this column is the relation to be used qualifying updates and deletions The current implementation requires one and only one property to be defined as @type {Boolean} | "isPrimaryKey": true, |
Indicates this column is the relation to be used qualifying updates and deletions @type {Boolean} | "isNaturalKey": true, |
Use to indicate a mandatory property. | "isRequired": true, |
Indicates a fixed value on which to filter all table reads and set as default on Useful for tables that store data of mixed types where one column holds @type {Any} | "value": "TA", |
Flags whether the proprety should be visible on query results or not. Useful when used in conjunction with "value" where there is no need to see the @type {Boolean} | "isVisible": false, |
Flags whether the property must be encrypted. When true, the data source must pass @type {Boolean} | "isEncrypted": false
}, |
Indicates this property will return the entire row to which this column is related. | "toOne": { |
The non-name space qualified type name of the object to which this property is Required. | "type": "UserAccountInfo", |
If true the returned value will contain the complete row for each matching record, otherwise @type {Boolean} | "isNested": true, |
The table column to map to. It should be a foreign key relation to the corresponding type. Required. @type {String} | "column": "prjtask_username", |
The property relation of the type on which to join. Will accept camel case or snake case Required. @type {String} | "inverse": "username", |
If true a join will be performed on the table instead of a left join to improve performance. @type {Boolean} | "isChild": false, |
A value to substitute if the client returns a null value. @type {Boolean} | "nullValue": -1
}, |
Indicates this property will return an array of all records to which it is related. | "toMany": { |
The type name of the objects to be included. Type name should be class case and not include Note that the toMany relationship will be dependent on an ORM of this type in a matching Required. @type {String} | "type": "ProjectTaskComment", |
The table column to map to. If not specified all rows for the type will be returned. @type {String} | "column": "prjtask_id", |
The key that is the relation to the column. Ignored if no column specified. @type {String} | "inverse": "project_task", |
Indicate column is on the base table. Useful for extensions where a toMany relationship is keyed off the base table but the extension refers to another extending table. @type {Boolean} | "isBase": false, |
If true the returned array will contain the complete row for each matching record, otherwise Nested records will be automatically deleted when the parent is deleted so long as their edit @see deletDelegate | "isNested": true
}
}
], |
The extensions array allows you to define addtional tables on which to join to the table table Note that the name space should not be included in extension arrays. It will be assumed | "extensions": [], |
Indicates the ORM has been created as part of an extension package. Helps to differentiate | "isSystem": false, |
Dictates the sequence that extensions are processed in. Higher sequences will add columns to the | "sequence": 0
} |