new ModelDefinition(modelBuilder, name, properties, settings) → {ModelDefinition}
Constructor for ModelDefinition
Parameters:
Name | Type | Description |
---|---|---|
modelBuilder |
ModelBuilder | A model builder instance |
name |
String | Object | The model name or the schema object |
properties |
Object | The model properties, optional |
settings |
Object | The model settings, optional |
- Source:
Returns:
- Type
- ModelDefinition
Methods
build(force)
Build a model definition
Parameters:
Name | Type | Description |
---|---|---|
force |
Boolean | Forcing rebuild |
- Source:
columnMetadata(connectorType, propertyName) → {Object}
Return column metadata for specified modelName and propertyName
Parameters:
Name | Type | Description |
---|---|---|
connectorType |
String | The connector type, such as 'oracle' or 'mongodb' |
propertyName |
The property name |
- Source:
Returns:
column metadata
- Type
- Object
columnName(connectorType, propertyName) → {String}
Return column name for specified modelName and propertyName
Parameters:
Name | Type | Description |
---|---|---|
connectorType |
String | The connector type, such as 'oracle' or 'mongodb' |
propertyName |
The property name |
- Source:
Returns:
columnName
- Type
- String
columnNames(connectorType) → {Array.<String>}
Return column names for specified modelName
Parameters:
Name | Type | Description |
---|---|---|
connectorType |
String | The connector type, such as 'oracle' or 'mongodb' |
- Source:
Returns:
column names
- Type
- Array.<String>
defineProperty(propertyName, propertyDefinition)
Define a property
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | The property name |
propertyDefinition |
Object | The property definition |
- Source:
idColumnName(modelName) → {String}
Find the ID column name
Parameters:
Name | Type | Description |
---|---|---|
modelName |
String | The model name |
- Source:
Returns:
columnName for ID
- Type
- String
idName() → {String}
Find the ID property name
- Source:
Returns:
property name for ID
- Type
- String
idNames() → {Array.<String>}
Find the ID property names sorted by the index
- Source:
Returns:
property names for IDs
- Type
- Array.<String>
ids() → {Array.<Object>}
Find the ID properties sorted by the index
- Source:
Returns:
property name/index for IDs
- Type
- Array.<Object>
indexes() → {Object}
- Source:
Returns:
- Type
- Object
tableName(connectorType)
Return table name for specified `modelName`
Parameters:
Name | Type | Description |
---|---|---|
connectorType |
String | The connector type, such as 'oracle' or 'mongodb' |
- Source: