new EntityManagerFactory(optionsopt)
Creates a new EntityManagerFactory connected to the given destination
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
string | Object |
<optional> |
The destination to connect with, or an options object |
|||||||||||||||||||||||||||||||||||||||||||||
Properties
|
- Source:
Extends
Members
code :util.Code
Type:
- Source:
connection :connector.Connector
Type:
- Source:
isReady :boolean
Indicates if there is currently no exclusive operation executedtrue
If no exclusive lock is hold
Type:
- boolean
- Inherited From:
- Source:
metamodel :metamodel.Metamodel
Type:
- Source:
staleness :number
Type:
- number
- Source:
tokenStorage :util.TokenStorage
Type:
- Source:
tokenStorageFactory :util.TokenStorageFactory
Type:
- Source:
Methods
configure(options) → {void}
Apply additional configurations to this EntityManagerFactory
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The additional configuration options |
|||||||||||||||||||||
Properties
|
- Source:
Returns:
- Type
- void
connect(hostOrApp, secureopt) → {Promise.<this>}
Connects this EntityManager to the given destination
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
hostOrApp |
string | The host or the app name to connect with |
||
secure |
boolean |
<optional> |
false |
|
- Source:
Returns:
- Type
- Promise.<this>
connect(hostOrApp, portopt, secureopt, basePathopt) → {Promise.<this>}
Connects this EntityManager to the given destination
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
hostOrApp |
string | The host or the app name to connect with |
||
port |
number |
<optional> |
80|443 | The port to connect to |
secure |
boolean |
<optional> |
false |
|
basePath |
string |
<optional> |
"/v1" | The base path of the api |
- Source:
Returns:
- Type
- Promise.<this>
createEntityManager(useSharedTokenStorageopt) → {EntityManager}
Create a new application-managed EntityManager.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
useSharedTokenStorage |
boolean |
<optional> |
The token storage to persist the authorization token, or |
- Source:
Returns:
a new entityManager
- Type
- EntityManager
createMetamodel() → {metamodel.Metamodel}
Creates a new Metamodel instance, which is not connected
- Source:
Returns:
A new Metamodel instance
- Type
- metamodel.Metamodel
ready(doneCallbackopt, failCallbackopt) → {Promise.<this>}
Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
doneCallback |
util.Lockable~doneCallback |
<optional> |
The callback which will be invoked when the previously |
failCallback |
util.Lockable~failCallback |
<optional> |
When the lock can't be released caused by a none |
- Inherited From:
- Source:
Returns:
A promise which completes successfully, when the previously requested
operation completes
- Type
- Promise.<this>
(protected) withLock(callback, criticalopt) → {Promise.<T>}
Try to aquire an exclusive lock and executes the given callback.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callback |
util.Lockable~callback | The exclusive operation to execute |
||
critical |
boolean |
<optional> |
false | Indicates if the operation is critical. If the operation is critical and the |
- Inherited From:
- util.Lockable#withLock<T>
- Source:
Throws:
-
If the lock can't be aquired
- Type
- Error
Returns:
A promise
- Type
- Promise.<T>