ServerRepository

ServerRepository~ ServerRepository

new ServerRepository(connection, entityName)

Create a new server side repository. Operate in two mode:

  • if connection is not passed, we consider this is server thread (i.e. operate with the same server code run in), and result of {ServerRepository#select} method is {TubDataStore}
  • if connection is passed, we consider this is remote server connection and result of {ServerRepository#select} is
Arguments:
  1. connection (UBConnection|null)  remote server connection
  2. entityName (String)  name of Entity we create for

Members

connection: UBConnection|null

Type:

Methods

selectAsObject(resultInPlainTextopt) → Array:.<Object:>|String

Arguments:
  1. [resultInPlainText=false] (Boolean)  If true - result is {String}

selectAsArray(resultInPlainTextopt) → TubCachedData|String

Arguments:
  1. [resultInPlainText=false] (Boolean)  If true - result is {String}

selectAsStore(instanceopt)TubDataStore|Array:.<Object:>

Create new, or use passed as parameter TubDataStore and run TubDataStore#select method passing result of CustomRepository#getRunListItem as config. Do not work for remote connection.
Arguments:
  1. [instance] (TubDataStore)  Optional instance for in-thread execution context. If passed - run select for it (not create new instance) and return instance as a result. Be careful - method do not check instance is created for entity you pass to Repository constructor.

select(instanceopt)TubDataStore

Arguments:
  1. [instance] (TubDataStore)  Optional instance for in-thread execution context. If passed - run select for it (not create new instance) and return instance as a result.