📄 iqueryservice.java
字号:
package com.esri.solutions.jitk.services.personalization;
import java.util.List;
import com.esri.solutions.jitk.personalization.dao.Criteria;
import com.esri.solutions.jitk.personalization.dao.IQueryDAO;
import com.esri.solutions.jitk.personalization.dao.PageInfo;
import com.esri.solutions.jitk.services.common.ServicesException;
import com.esri.solutions.jitk.services.personalization.data.QueryData;
/**
* Interface defining methods that are necessary for the implementation of a Web Service that
* manages and queries queries. The queries are stored in some form of a datastore, which is
* accessed through a {@link IQueryDAO}.
* <p>
* The {@link IQueryDAO} is responsible for all aspects of creating, selecting, updating and deleting
* query. Thus, it is the DAO that builds the queries, whereas this object simply abstracts away that
* DAO for the purposes of creating a web service.
* </p>
*/
public interface IQueryService {
/**
* Retrieves the Data Access Object (DAO) that accesses the query datastore.
* @return {@link IQueryDAO} implementation
*/
public IQueryDAO getDAO();
/**
* Inserts a single query into the datastore.
* @param data The {@link QueryData} representation of the query to insert.
*/
public void insert(QueryData data) throws ServicesException;
/**
* Updates a query with the given {@link QueryData#getId() id} with the specified information.
* @param data The {@link QueryData} encapsulation of the new query information.
*/
public void update(QueryData data) throws ServicesException;
/**
* Removes a single query from the datastore.
* @param id {@link String} containing the ID of the query to remove.
*/
public void delete(String id) throws ServicesException;
/**
* Retrieves a single query, specified by its ID, from the datastore.
* @param id {@link String} containing the ID of the query to retrieve.
* @return {@link QueryData} representation of the requested query.
*/
public QueryData selectOne(String id) throws ServicesException;
/**
* Retrieves all queries whose properties match those specified by the {@code criteria} parameter.
* @param criteria {@link Criteria} encapsulation of the "query" query parameters
* @return A {@link List} of {@link QueryData} objects that match the specified criteria.
*/
public List<QueryData> selectAll(Criteria criteria)
throws ServicesException;
/**
* Selects a count of all queries whose properties match those specified by the {@code criteria} parameter.
* @param criteria {@link Criteria} encapsulation of the "query" query parameters
* @return {@code int} containing the count.
*/
public int selectAllCount(Criteria criteria) throws ServicesException;
/**
* Retrieves a subset of the queries whose criteria match those specified by the {@code criteria} parameter.
* <p>
* This method is similar to {@link #selectAll(Criteria)}, except in that it utilizes the {@code pageInfo} parameter
* to determine a subset of results to display. This method is useful, in particular, for displaying paged results
* and limiting the amount of data returned to the client.
* </p>
* {@code pageInfo} parameter to specify the subset
* @param criteria {@link Criteria} encapsulation of the "query" query parameters
* @param pageInfo {@link PageInfo} encapsulating the information used to determine the page of results
* @return A {@link List} of {@link QueryData} objects that match the specified criteria, and fall within the specified subset
* of the actual results.
*/
public List<QueryData> selectPage(Criteria criteria,
PageInfo pageInfo) throws ServicesException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -