Bluestep JS Documentation
    Preparing search index...

    Class DB

    TODO

    TODO
    
    Index

    Constructors

    Properties

    FieldDataType: typeof FieldDataType

    The [[FieldDataType]].

    Propagation: typeof Propagation

    The [[Propagation]].

    session: Session

    The [[Session]].

    SortDirection: typeof SortDirection

    The [[SortDirection]].

    Methods

    • A restricted function that clears a [[Lock]] given its name. The result is a boolean value indicating success.

      Parameters

      • name: string

      Returns boolean

      const didClear = B.clearLock('myLock');
      
    • Find a drug by it's product identification.

      Parameters

      • productID: string

        Product id of the drug being looked up

      Returns Drug

      const drug = B.drug('3432445');
      
    • This method executes a custom SQL query defined in Org Admin->Super. The callback function will return provide a [[Java.SQL.ResultSet]] for each row. For an updateable query, this method returns the number of rows modified.

      Parameters

      • id: string

        The id of the custom query to be executed.

      • Optionalparams: any[]

        A list of parameters to pass to the custom query. The number of parameters and the types of the parameters are defined by the custom query. Possible parameter types which may be used in a custom query are: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, VARCHAR, ORACLECLOB, DATE, TIME, TIMESTAMP, BOOLEAN, RAW and SCHEMA. Arguments passed are converted to their SQL specific types by Bluestep and internal conversions. For instance, TIMESTAMP values are first converted to Calendar values then to java.sql.TimeStamp values internally. All parameters have null value logic and are set via PreparedStatement setType() methods (where 'Type' is the actual type name) except RAW and SCHEMA. These two types are set via QueryString by calling setRawString() and setSubject() respectively. The two special types are set beginning from the last occurance and preceeding backward to the first, eliminating the parameters from the list as it goes thus preserving correct indexing. Then remaining parameters are set via PreparedStatement, first to last.

      • OptionalrowConsumer: (id: string, rowSet: ResultSet) => void

      Returns number

    • This method executes a custom SQL query defined in Org Admin->Super. The callback function will return provide a [[Java.SQL.ResultSet]] for each row. For an updateable query, this method returns the number of rows modified.

      Parameters

      • id: string

        The id of the custom query to be executed.

      • Optionalparams: any[]

        A list of parameters to pass to the custom query. The number of parameters and the types of the parameters are defined by the custom query. Possible parameter types which may be used in a custom query are: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, VARCHAR, ORACLECLOB, DATE, TIME, TIMESTAMP, BOOLEAN, RAW and SCHEMA. Arguments passed are converted to their SQL specific types by Bluestep and internal conversions. For instance, TIMESTAMP values are first converted to Calendar values then to java.sql.TimeStamp values internally. All parameters have null value logic and are set via PreparedStatement setType() methods (where 'Type' is the actual type name) except RAW and SCHEMA. These two types are set via QueryString by calling setRawString() and setSubject() respectively. The two special types are set beginning from the last occurance and preceeding backward to the first, eliminating the parameters from the list as it goes thus preserving correct indexing. Then remaining parameters are set via PreparedStatement, first to last.

      • Optionalobjs: string[]

        TODO

      • OptionalrowConsumer: (id: string, rowSet: ResultSet) => void

      Returns number

    • Use lookup service

      Parameters

      • lookup: string

        Service name

      • search: string

        What to search for

      • Optionalparams: { [key: string]: any }

        Custom params for this search.

      Returns EList<{ [key: string]: string }>

      const results = B.lookup('drug','tylenol');
      
    • This method the current user's recent records list to be inspected and modified. When inspecting recent records it is possible to get each record's name, id, unit, record type and current categories. Recent records can be read and manipulated. See also [[User.recentRecords]] and [[Relate.BaseRecord.recentRecords]]

      Returns Optional<RecentRecords>

    • Same as calling B.optRecentRecords().orElse(null).

      Returns RecentRecords

    • User transaction management

      Parameters

      Returns Transaction

      const message = B.userTransaction({propagationBehavior: B.Propagation.NESTED})
      .optCommitIf( () => { return true;})
      .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
      .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
      .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
      .map(nextTrans => "All Transactions Successful")
      .orElse("A transaction failed");