class staticbo.shared. ExtensionManagerBase
Source: shared/
Provides properties to customize models' behavior.
Properties
new ExtensionManagerBase(dataSource, modelPath, addArgs)
Creates a new base extension manager object.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataSource |
string |
|
The name of the data source. |
modelPath |
string |
|
The full path of the model. |
addArgs |
number |
|
The count of additional arguments for data portal methods of a model group. |
- Throws
-
Argument error: The data source must be a non-empty string.
-
Argument error: The model path must be a non-empty string.
-
Argument error: The additional argument count must be an integer.
Properties
read-onlydaoBuilder
external.daoBuilder
Factory method to create the data access object for a model instance.
read-onlydataCreate
external.dataCreate
Returns the property values of a new instance from the data source.
read-onlydataExecute
external.dataExecute
Executes a command on the data source.
read-onlydataFetch
external.dataFetch
Returns the property values of an existing instance from the data source.
read-onlydataInsert
external.dataInsert
Saves a new instance into the data source.
read-onlydataRemove
external.dataRemove
Deletes an existing instance from the data source.
read-onlydataSource
string
The name of the data source.
read-onlydataUpdate
external.dataUpdate
Saves an existing instance into the data source.
read-onlyfromCto
external.fromCto
Converts the client transfer object to model instance.
read-onlyfromDto
external.fromDto
Converts the data transfer object to model instance.
read-onlymodelPath
string
The path of the model definition.
read-onlytoCto
external.toCto
Converts the model instance to client transfer object.
read-onlytoDto
external.toDto
Converts the model instance to data transfer object.
Methods
addOtherMethod(methodName)
Adds a new instance method to the model. (The method will call a custom execute method on the data business object of command object.)
Parameter
Name | Type | Optional | Description |
---|---|---|---|
methodName |
string |
|
The name of the method on the data access object to be called. |
protectedbuildOtherMethods(instance, isSync)
Instantiate the defined custom methods on the model instance. (The method is currently used by command objects only.)
Parameters
Name | Type | Optional | Description |
---|---|---|---|
instance |
|
An instance of the model. |
|
isSync |
boolean |
|
Indicates whether the model is synchronous or asynchronous. |
protectedgetDataAccessObject(modelName) → bo.dataAccess.DaoBase
Gets the data access object instance of the model.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
modelName |
string |
|
The name of the model. |
- Returns
-
bo.dataAccess.DaoBase
The data access object instance of the model.