Class GroovyLookupTable

java.lang.Object
com.imc.iss.groovy.lookupTable.GroovyLookupTable

public class GroovyLookupTable extends Object
This class provide the API for groovy script to form the sql query and access lookup table
  • Method Details

    • addCondition

      public GroovyLookupTable addCondition(String fieldName, String operator, Object value) throws IMCException
      To add the condition for a SQL query
      Parameters:
      fieldName - as String the name of the lookup table field.
      operator - as String the operator for condition.

      "==" represents EQUAL

      "!=" represents NOT EQUAL

      ">" represents GREATER THAN

      ">=" represents GREATER THAN EQUAL

      "<" represents LESS_THAN

      "<=" represents LESS THAN EQUALL.

      value - as Object the value of the condition.
      Throws:
      IMCException - the platform exception.
    • addOrderBy

      public GroovyLookupTable addOrderBy(String fieldName, String order) throws IMCException
      To add SQL sorting criteria. This function may be called multiple times. The result will be ordered by the field that were added first, then by the second field, and so on
      Parameters:
      fieldName - as String the name of the lookup table field.
      order - as String the order of the sorting (ASC or DESC).
      Throws:
      IMCException - the platform exception.
    • addSelectFields

      public GroovyLookupTable addSelectFields(String... fieldNames) throws IMCException
      To define the selecting specific columns in a lookup table.
      Parameters:
      fieldNames - as String arguments the lookup table fields to retrieve.
      Throws:
      IMCException - the platform exception.
    • delete

      public void delete(Long id) throws IMCException
      Throws:
      IMCException
    • getAccessibleTables

      public List<String> getAccessibleTables()
      To retrieve the list of the lookup table name which the script has access to it.
      Returns:
      lookup table name as List<String>
    • insert

      public void insert() throws IMCException
      Throws:
      IMCException
    • isSQL_AND_Condition

      public void isSQL_AND_Condition(boolean flag)
      Flag to indicate using AND or OR SQL condition operator to join all SQL conditions
      Parameters:
      flag - as boolean. Boolean true = AND, false = OR
    • search

      public List<Map<String,Object>> search() throws IMCException
      Throws:
      IMCException
    • searchOne

      public Map<String,Object> searchOne() throws IMCException
      Throws:
      IMCException
    • setFieldValue

      public GroovyLookupTable setFieldValue(String fieldName, Object value) throws IMCException
      Throws:
      IMCException
    • table

      public GroovyLookupTable table(String tableName) throws IMCException
      Throws:
      IMCException
    • update

      public void update(Long id) throws IMCException
      Throws:
      IMCException