Class BusinessObjectTool


  • public class BusinessObjectTool
    extends java.lang.Object
    Helper class to manipulate business objects in specific code
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long count()
      Helper method to process a count (with current filters) throwing exception in case of error
      long count​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Helper method to process a filtered count (with current filters) throwing exception in case of error
      long count​(org.json.JSONObject filters)
      Helper method to process a filtered count throwing exception in case of error
      BusinessObjectTool.ReturnMessage create()
      Helper method to process create save throwing exception in case of error
      Forces row ID at objectField.DEFAULT_ROW_ID and calls save
      BusinessObjectTool.ReturnMessage create​(boolean undoredo)
      Helper method to process create save throwing exception in case of error
      Forces row ID at objectField.DEFAULT_ROW_ID and calls save
      BusinessObjectTool.ReturnMessage del()
      Alias to delete (naming suitable for script usage)
      BusinessObjectTool.ReturnMessage del​(boolean undoredo)
      Alias to delete (naming suitable for script usage)
      BusinessObjectTool.ReturnMessage delete()
      Helper method to process deletion throwing exception in case of error
      BusinessObjectTool.ReturnMessage delete​(boolean undoredo)
      Helper method to process deletion throwing exception in case of error
      void get​(java.lang.String rowId)
      Helper method to process row selection throwing exception in case of error
      java.lang.String get​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Helper method to process a single row selection throwing exception in case of error or if the passed filters returns more than one record
      java.lang.String get​(org.json.JSONObject filters)
      Helper method to process a single row selection throwing exception in case of error or if the passed filters returns more than one record
      void getForCopy​(java.lang.String rowId)
      Helper method to process row selection for copy throwing exception in case of error
      void getForCopy​(java.lang.String rowId, boolean init)
      Helper method to process row selection for copy throwing exception in case of error
      void getForCreate()
      Helper method to process row initialization for create throwing exception in case of error
      void getForCreate​(boolean init)
      Helper method to process row initialization for create throwing exception in case of error
      boolean getForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
      boolean getForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters, boolean init)
      Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
      boolean getForCreateOrUpdate​(org.json.JSONObject filters)
      Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
      boolean getForCreateOrUpdate​(org.json.JSONObject filters, boolean init)
      Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
      boolean getForCreateOrUpdate​(org.json.JSONObject filters, boolean init, boolean functIdOnly)
      Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
      void getForDelete​(java.lang.String rowId)
      Helper method to process row selection for deletion throwing exception in case of error
      void getForDelete​(java.lang.String rowId, boolean init)
      Helper method to process row selection for deletion throwing exception in case of error
      void getForUpdate​(java.lang.String rowId)
      Helper method to process row selection for update throwing exception in case of error
      void getForUpdate​(java.lang.String rowId, boolean init)
      Helper method to process row selection for update throwing exception in case of error
      boolean getForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Alias to getForCreateOrUpdate
      boolean getForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters, boolean init)
      Alias to getForCreateOrUpdate
      boolean getForUpsert​(org.json.JSONObject filters)
      Alias to getForCreateOrUpdate
      boolean getForUpsert​(org.json.JSONObject filters, boolean init)
      Alias to getForCreateOrUpdate
      ObjectDB getObject()
      Get object
      void log​(java.lang.String method, PlatformException e)
      Helper method to handle a platform exception as a log entry (for code EXCEPTION)
      BusinessObjectTool.ReturnMessage save()
      Helper method to process save (create or update) throwing appropriate exception in case of error
      BusinessObjectTool.ReturnMessage save​(boolean timestamp)
      Helper method to process save (create or update) throwing appropriate exception in case of error
      BusinessObjectTool.ReturnMessage save​(boolean timestamp, boolean undoredo)
      Helper method to process save (create or update) throwing appropriate exception in case of error
      java.util.List<java.lang.String[]> search()
      Helper method to process a non paginated search (with current filters) throwing exception in case of error
      java.util.List<java.lang.String[]> search​(int pageSize, int page)
      Helper method to process an paginated search (with current filters) throwing exception in case of error
      void search​(int pageSize, ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
      Helper method to process a paginated search (with current filters) throwing exception in case of error
      java.util.List<java.lang.String[]> search​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Helper method to process a filtered search throwing exception in case of error
      void search​(java.util.Map<java.lang.String,​java.lang.String> filters, int pageSize, ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
      Helper method to process a filtered paginated search throwing exception in case of error
      java.util.List<java.lang.String[]> search​(org.json.JSONObject filters)
      Helper method to process a filtered non paginated search throwing exception in case of error
      java.util.List<java.lang.String[]> search​(org.json.JSONObject filters, int pageSize, int page)
      Helper method to process a paginated filtered search throwing exception in case of error
      void search​(org.json.JSONObject filters, int pageSize, ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
      Helper method to process a filtered paginated search throwing exception in case of error
      void select​(java.lang.String rowId)
      Alias of get
      java.lang.String select​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Alias to getForCreateOrUpdate
      java.lang.String select​(org.json.JSONObject filters)
      Alias to get
      void selectForCopy​(java.lang.String rowId)
      Alias of getForCopy
      void selectForCopy​(java.lang.String rowId, boolean init)
      Alias of getForCopy
      void selectForCreate()
      Alias of getForCreate
      void selectForCreate​(boolean init)
      Alias of getForCreate
      boolean selectForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Alias to getForCreateOrUpdate
      boolean selectForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters, boolean init)
      Alias to getForCreateOrUpdate
      boolean selectForCreateOrUpdate​(org.json.JSONObject filters)
      Alias to getForCreateOrUpdate
      boolean selectForCreateOrUpdate​(org.json.JSONObject filters, boolean init)
      Alias to getForCreateOrUpdate
      void selectForDelete​(java.lang.String rowId)
      Alias to getForDelete
      void selectForDelete​(java.lang.String rowId, boolean init)
      Alias to getForDelete
      void selectForUpdate​(java.lang.String rowId)
      Alias to getForUpdate
      void selectForUpdate​(java.lang.String rowId, boolean init)
      Alias to getForUpdate
      boolean selectForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters)
      Alias to getForCreateOrUpdate
      boolean selectForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters, boolean init)
      Alias to getForCreateOrUpdate
      boolean selectForUpsert​(org.json.JSONObject filters)
      Alias to getForCreateOrUpdate
      boolean selectForUpsert​(org.json.JSONObject filters, boolean init)
      Alias to getForCreateOrUpdate
      java.util.List<BusinessObjectTool.ReturnMessage> selectValidateAndSave​(java.lang.String rowId, boolean copy, boolean timestamp, boolean redolog, org.json.JSONObject fieldValues)
      Helper to force access rights, select a record, set values, validate and save and restore rights access, in a synchronized block.
      java.util.List<BusinessObjectTool.ReturnMessage> selectValidateAndSave​(java.lang.String rowId, boolean copy, boolean timestamp, java.util.Map<java.lang.String,​java.lang.String> fieldValues)
      Helper to force access rights, select a record, set values, validate and save and restore rights access, in a synchronized block.
      double sum​(java.lang.String field, java.util.List<java.lang.String[]> rows)
      Helper method to process sum for a given field from given rows throwing exception in case of error
      double sum​(java.lang.String field, java.util.Map<java.lang.String,​java.lang.String> filters)
      Helper method to process sum for a given field from a filtered search throwing exception in case of error
      double sum​(java.lang.String field, org.json.JSONObject filters)
      Helper method to process sum for a given field from a filtered search throwing exception in case of error
      BusinessObjectTool.ReturnMessage update()
      Helper method to process update save throwing exception in case of error
      BusinessObjectTool.ReturnMessage update​(boolean timestamp)
      Helper method to process update save throwing exception in case of error
      BusinessObjectTool.ReturnMessage update​(boolean timestamp, boolean undoredo)
      Helper method to process update save throwing exception in case of error
      java.util.List<BusinessObjectTool.ReturnMessage> validate()
      Helper method to process validation throwing exception in case of error(s)
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndCreate()
      Helper method to process validation and create save throwing appropriate exception in case of error(s)
      Forces row ID at objectField.DEFAULT_ROW_ID and calls validateAndSave
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndCreate​(boolean undoredo)
      Helper method to process validation and create save throwing appropriate exception in case of error(s)
      Forces row ID at objectField.DEFAULT_ROW_ID and calls validateAndSave
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndSave()
      Helper method to process validation and save (create or update) throwing appropriate exception in case of error(s)
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndSave​(boolean timestamp)
      Helper method to process validation and save (create or update) throwing appropriate exception in case of error(s)
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndSave​(boolean timestamp, boolean undoredo)
      Helper method to process validation and save (create or update) throwing appropriate exception in case of error(s)
      java.util.List<java.lang.String[]> validateAndSearch()
      Helper method to process search validation and search throwing exception in case of error
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndUpdate()
      Helper method to process validation and update save throwing appropriate exception in case of error(s)
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndUpdate​(boolean timestamp)
      Helper method to process validation and update save throwing appropriate exception in case of error(s)
      java.util.List<BusinessObjectTool.ReturnMessage> validateAndUpdate​(boolean timestamp, boolean undoredo)
      Helper method to process validation and update save throwing appropriate exception in case of error(s)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BusinessObjectTool

        public BusinessObjectTool​(ObjectDB object)
        Constructor
        Parameters:
        object - Business object
      • BusinessObjectTool

        public BusinessObjectTool​(Grant grant,
                                  java.lang.String objectName,
                                  java.lang.String objectIntanceName)
        Constructor
        Parameters:
        grant - Grant
        objectName - Object name
        objectIntanceName - Object instance name
    • Method Detail

      • getObject

        public ObjectDB getObject()
        Get object
        Returns:
        Object
      • get

        public void get​(java.lang.String rowId)
                 throws GetException
        Helper method to process row selection throwing exception in case of error
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • select

        public void select​(java.lang.String rowId)
                    throws GetException
        Alias of get
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • getForCreate

        public void getForCreate()
                          throws GetException
        Helper method to process row initialization for create throwing exception in case of error
        Throws:
        GetException
      • getForCreate

        public void getForCreate​(boolean init)
                          throws GetException
        Helper method to process row initialization for create throwing exception in case of error
        Parameters:
        init - Call the creation init hook?
        Throws:
        GetException
      • selectForCreate

        public void selectForCreate​(boolean init)
                             throws GetException
        Alias of getForCreate
        Parameters:
        init - Call the creation init hook?
        Throws:
        GetException
      • getForCopy

        public void getForCopy​(java.lang.String rowId)
                        throws GetException
        Helper method to process row selection for copy throwing exception in case of error
        Parameters:
        rowId - Row ID of row to copy from
        Throws:
        GetException
      • getForCopy

        public void getForCopy​(java.lang.String rowId,
                               boolean init)
                        throws GetException
        Helper method to process row selection for copy throwing exception in case of error
        Parameters:
        rowId - Row ID of row to copy from
        init - Call the copy init hook?
        Throws:
        GetException
      • selectForCopy

        public void selectForCopy​(java.lang.String rowId)
                           throws GetException
        Alias of getForCopy
        Parameters:
        rowId - Row ID of row to copy from
        Throws:
        GetException
      • selectForCopy

        public void selectForCopy​(java.lang.String rowId,
                                  boolean init)
                           throws GetException
        Alias of getForCopy
        Parameters:
        rowId - Row ID of row to copy from
        init - Call the copy init hook?
        Throws:
        GetException
      • getForUpdate

        public void getForUpdate​(java.lang.String rowId)
                          throws GetException
        Helper method to process row selection for update throwing exception in case of error
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • getForUpdate

        public void getForUpdate​(java.lang.String rowId,
                                 boolean init)
                          throws GetException
        Helper method to process row selection for update throwing exception in case of error
        Parameters:
        rowId - Row ID of row to get
        init - Call the update init hook?
        Throws:
        GetException
      • selectForUpdate

        public void selectForUpdate​(java.lang.String rowId)
                             throws GetException
        Alias to getForUpdate
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • selectForUpdate

        public void selectForUpdate​(java.lang.String rowId,
                                    boolean init)
                             throws GetException
        Alias to getForUpdate
        Parameters:
        rowId - Row ID of row to get
        init - Call the update init hook?
        Throws:
        GetException
      • get

        public java.lang.String get​(org.json.JSONObject filters)
                             throws GetException
        Helper method to process a single row selection throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        the row ID of the found row
        Throws:
        GetException - if no record or more than one row is found
      • select

        public java.lang.String select​(org.json.JSONObject filters)
                                throws GetException
        Alias to get
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        the row ID of the found row
        Throws:
        GetException - if no record or more than one row is found
      • get

        public java.lang.String get​(java.util.Map<java.lang.String,​java.lang.String> filters)
                             throws GetException
        Helper method to process a single row selection throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        the row ID of the found row
        Throws:
        GetException - if no record or more than one row is found
      • select

        public java.lang.String select​(java.util.Map<java.lang.String,​java.lang.String> filters)
                                throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Throws:
        GetException - if no record or more than one row is found
      • getForCreateOrUpdate

        public boolean getForCreateOrUpdate​(org.json.JSONObject filters)
                                     throws GetException
        Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForCreateOrUpdate

        public boolean getForCreateOrUpdate​(org.json.JSONObject filters,
                                            boolean init)
                                     throws GetException
        Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForCreateOrUpdate

        public boolean getForCreateOrUpdate​(org.json.JSONObject filters,
                                            boolean init,
                                            boolean functIdOnly)
                                     throws GetException
        Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        functIdOnly - Search only with functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForCreateOrUpdate

        public boolean selectForCreateOrUpdate​(org.json.JSONObject filters)
                                        throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForCreateOrUpdate

        public boolean selectForCreateOrUpdate​(org.json.JSONObject filters,
                                               boolean init)
                                        throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForUpsert

        public boolean getForUpsert​(org.json.JSONObject filters)
                             throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForUpsert

        public boolean getForUpsert​(org.json.JSONObject filters,
                                    boolean init)
                             throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForUpsert

        public boolean selectForUpsert​(org.json.JSONObject filters)
                                throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForUpsert

        public boolean selectForUpsert​(org.json.JSONObject filters,
                                       boolean init)
                                throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters JSON object (allows webservice naming), should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForCreateOrUpdate

        public boolean getForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters)
                                     throws GetException
        Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForCreateOrUpdate

        public boolean getForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters,
                                            boolean init)
                                     throws GetException
        Helper method to process row selection for create or update (upsert) throwing exception in case of error or if the passed filters returns more than one record
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForCreateOrUpdate

        public boolean selectForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters)
                                        throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForCreateOrUpdate

        public boolean selectForCreateOrUpdate​(java.util.Map<java.lang.String,​java.lang.String> filters,
                                               boolean init)
                                        throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForUpsert

        public boolean getForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters)
                             throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForUpsert

        public boolean getForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters,
                                    boolean init)
                             throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForUpsert

        public boolean selectForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters)
                                throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • selectForUpsert

        public boolean selectForUpsert​(java.util.Map<java.lang.String,​java.lang.String> filters,
                                       boolean init)
                                throws GetException
        Alias to getForCreateOrUpdate
        Parameters:
        filters - Filters map, should at least include filters on all functional key fields
        init - Call the creation/updat init hook?
        Returns:
        True if an existing record was selected for update and false if record was initialized for creation
        Throws:
        GetException
      • getForDelete

        public void getForDelete​(java.lang.String rowId)
                          throws GetException
        Helper method to process row selection for deletion throwing exception in case of error
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • getForDelete

        public void getForDelete​(java.lang.String rowId,
                                 boolean init)
                          throws GetException
        Helper method to process row selection for deletion throwing exception in case of error
        Parameters:
        rowId - Row ID of row to get
        init - Call the deletion init hook?
        Throws:
        GetException
      • selectForDelete

        public void selectForDelete​(java.lang.String rowId)
                             throws GetException
        Alias to getForDelete
        Parameters:
        rowId - Row ID of row to get
        Throws:
        GetException
      • selectForDelete

        public void selectForDelete​(java.lang.String rowId,
                                    boolean init)
                             throws GetException
        Alias to getForDelete
        Parameters:
        rowId - Row ID of row to get
        init - Call the deletion init hook?
        Throws:
        GetException
      • count

        public long count()
                   throws SearchException
        Helper method to process a count (with current filters) throwing exception in case of error
        Returns:
        Count result
        Throws:
        SearchException
      • count

        public long count​(org.json.JSONObject filters)
                   throws SearchException
        Helper method to process a filtered count throwing exception in case of error
        Parameters:
        filters - Filters JSON object (allows webservice naming)
        Returns:
        Count result
        Throws:
        SearchException
      • count

        public long count​(java.util.Map<java.lang.String,​java.lang.String> filters)
                   throws SearchException
        Helper method to process a filtered count (with current filters) throwing exception in case of error
        Parameters:
        filters - Filters map
        Returns:
        Count result
        Throws:
        SearchException
      • search

        public java.util.List<java.lang.String[]> search()
                                                  throws SearchException
        Helper method to process a non paginated search (with current filters) throwing exception in case of error
        Returns:
        Search result
        Throws:
        SearchException
      • search

        public java.util.List<java.lang.String[]> search​(int pageSize,
                                                         int page)
                                                  throws SearchException
        Helper method to process an paginated search (with current filters) throwing exception in case of error
        Parameters:
        pageSize - Page size
        page - Page number (0 is first page, -1 means non paginated)
        Returns:
        Search result
        Throws:
        SearchException
      • search

        public void search​(int pageSize,
                           ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
                    throws SearchException
        Helper method to process a paginated search (with current filters) throwing exception in case of error
        Parameters:
        pageSize - Page size
        onPage - Page handler called for each page
        Throws:
        SearchException
      • search

        public java.util.List<java.lang.String[]> search​(org.json.JSONObject filters)
                                                  throws SearchException
        Helper method to process a filtered non paginated search throwing exception in case of error
        Parameters:
        filters - Filters JSON object (allows webservice naming)
        Returns:
        Search result
        Throws:
        SearchException
      • search

        public java.util.List<java.lang.String[]> search​(org.json.JSONObject filters,
                                                         int pageSize,
                                                         int page)
                                                  throws SearchException
        Helper method to process a paginated filtered search throwing exception in case of error
        Parameters:
        filters - Filters JSON object (allows webservice naming)
        pageSize - Page size
        page - Page number (0 is first page, -1 means non paginated)
        Returns:
        Search result
        Throws:
        SearchException
      • search

        public void search​(org.json.JSONObject filters,
                           int pageSize,
                           ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
                    throws SearchException
        Helper method to process a filtered paginated search throwing exception in case of error
        Parameters:
        filters - Filters JSON object (allows webservice naming)
        pageSize - Page size
        onPage - Page handler called for each page
        Throws:
        SearchException
      • search

        public java.util.List<java.lang.String[]> search​(java.util.Map<java.lang.String,​java.lang.String> filters)
                                                  throws SearchException
        Helper method to process a filtered search throwing exception in case of error
        Parameters:
        filters - Filters map
        Returns:
        Search result
        Throws:
        SearchException
      • search

        public void search​(java.util.Map<java.lang.String,​java.lang.String> filters,
                           int pageSize,
                           ObjectDB.SearchCallback<java.util.List<java.lang.String[]>> onPage)
                    throws SearchException
        Helper method to process a filtered paginated search throwing exception in case of error
        Parameters:
        filters - Filters map
        pageSize - Page size
        onPage - Page handler called for each page
        Throws:
        SearchException
      • sum

        public double sum​(java.lang.String field,
                          org.json.JSONObject filters)
                   throws ParamsException,
                          SearchException
        Helper method to process sum for a given field from a filtered search throwing exception in case of error
        Parameters:
        field - Field name
        filters - Filters JSON object (allows webservice naming)
        Returns:
        Sum result
        Throws:
        ParamsException
        SearchException
      • sum

        public double sum​(java.lang.String field,
                          java.util.Map<java.lang.String,​java.lang.String> filters)
                   throws ParamsException,
                          SearchException
        Helper method to process sum for a given field from a filtered search throwing exception in case of error
        Parameters:
        field - Field name
        filters - Filters map
        Returns:
        Sum result
        Throws:
        ParamsException
        SearchException
      • sum

        public double sum​(java.lang.String field,
                          java.util.List<java.lang.String[]> rows)
                   throws ParamsException,
                          SearchException
        Helper method to process sum for a given field from given rows throwing exception in case of error
        Parameters:
        field - Field name
        rows - Rows
        Returns:
        Sum result
        Throws:
        ParamsException
        SearchException
      • save

        public BusinessObjectTool.ReturnMessage save​(boolean timestamp)
                                              throws SaveException
        Helper method to process save (create or update) throwing appropriate exception in case of error
        Parameters:
        timestamp - check and update the timestamp if any
        Returns:
        Information/warning message or null
        Throws:
        SaveException
      • save

        public BusinessObjectTool.ReturnMessage save​(boolean timestamp,
                                                     boolean undoredo)
                                              throws SaveException
        Helper method to process save (create or update) throwing appropriate exception in case of error
        Parameters:
        timestamp - check and update the timestamp if any
        undoredo - create the redolog if any
        Returns:
        Information/warning message or null
        Throws:
        SaveException
      • create

        public BusinessObjectTool.ReturnMessage create​(boolean undoredo)
                                                throws CreateException
        Helper method to process create save throwing exception in case of error
        Forces row ID at objectField.DEFAULT_ROW_ID and calls save
        Parameters:
        undoredo - create the redolog if any
        Returns:
        Information/warning message or null
        Throws:
        CreateException
      • update

        public BusinessObjectTool.ReturnMessage update​(boolean timestamp,
                                                       boolean undoredo)
                                                throws UpdateException
        Helper method to process update save throwing exception in case of error
        Parameters:
        timestamp - check and update the timestamp if any
        undoredo - create the redolog if any
        Returns:
        Information/warning message or null
        Throws:
        UpdateException
      • selectValidateAndSave

        public java.util.List<BusinessObjectTool.ReturnMessage> selectValidateAndSave​(java.lang.String rowId,
                                                                                      boolean copy,
                                                                                      boolean timestamp,
                                                                                      java.util.Map<java.lang.String,​java.lang.String> fieldValues)
                                                                               throws GetException,
                                                                                      ValidateException,
                                                                                      SaveException
        Helper to force access rights, select a record, set values, validate and save and restore rights access, in a synchronized block.
        Parameters:
        rowId - Row ID to select
        copy - Select for copy?
        timestamp - Check and update the timestamp if any
        fieldValues - Pairs of field / value
        Returns:
        Information/warning messages or null
        Throws:
        GetException
        ValidateException
        SaveException
      • selectValidateAndSave

        public java.util.List<BusinessObjectTool.ReturnMessage> selectValidateAndSave​(java.lang.String rowId,
                                                                                      boolean copy,
                                                                                      boolean timestamp,
                                                                                      boolean redolog,
                                                                                      org.json.JSONObject fieldValues)
                                                                               throws GetException,
                                                                                      ValidateException,
                                                                                      SaveException
        Helper to force access rights, select a record, set values, validate and save and restore rights access, in a synchronized block.
        Parameters:
        rowId - Row ID to select
        copy - Select for copy?
        timestamp - Check and update the timestamp if any
        redolog - Create the redolog if any
        fieldValues - Pairs of field / value
        Returns:
        Information/warning messages or null
        Throws:
        GetException
        ValidateException
        SaveException
      • validateAndSave

        public java.util.List<BusinessObjectTool.ReturnMessage> validateAndSave​(boolean timestamp,
                                                                                boolean undoredo)
                                                                         throws ValidateException,
                                                                                SaveException
        Helper method to process validation and save (create or update) throwing appropriate exception in case of error(s)
        Parameters:
        timestamp - check and update the timestamp if any
        undoredo - create the redolog if any
        Returns:
        Information/warning messages or null
        Throws:
        ValidateException
        SaveException
      • log

        public void log​(java.lang.String method,
                        PlatformException e)
        Helper method to handle a platform exception as a log entry (for code EXCEPTION)
        Parameters:
        method - Method
        e - Any Platform exception