Class ModelDataSourceService

    • Constructor Detail

      • ModelDataSourceService

        public ModelDataSourceService()
    • Method Detail

      • add

        public String add​(Map<String,​String> parameters,
                          String content)
        Description copied from interface: DataSourceService
        Execute an insert action.
        Parameters:
        parameters - the parameters often coming from the HTTP request
        content - , the request content, is assumed to be a json string
        Returns:
        the result message as a json string
      • fetch

        public String fetch​(Map<String,​String> parameters)
        Description copied from interface: DataSourceService
        Execute a query request and return the result as a json string.
        Parameters:
        parameters - the parameters often coming from the HTTP request
        Returns:
        the json result string
      • remove

        public String remove​(Map<String,​String> parameters)
        Description copied from interface: DataSourceService
        Execute a delete action. The id of the deleted record is present in the parameters.
        Parameters:
        parameters - the parameters often coming from the HTTP request
        Returns:
        the result message as a json string
      • update

        public String update​(Map<String,​String> parameters,
                             String content)
        Description copied from interface: DataSourceService
        Execute an update action.
        Parameters:
        parameters - the parameters often coming from the HTTP request
        content - , the request content, is assumed to be a json string
        Returns:
        the result message as a json string
      • getBaseEntity

        protected Entity getBaseEntity​(Map<String,​String> parameters)
        Returns an entity based on the table record id. Returns null if the ipadTableId input is not present or no Entity is found for a given table id.
        Parameters:
        parameters - Map of the parameters from the request
        Returns:
        the Entity or null if not found
      • getEntityProperties

        protected List<Property> getEntityProperties​(Entity entity)
        Returns the list of properties sorted alphabetically and with a extra _identifier property
        Parameters:
        entity - the parent Entity from which the Property will be extracted
        Returns:
        a list of properties plus an extra _identifier property