瀏覽代碼

增加注释

zhouhao 7 年之前
父節點
當前提交
15d42b77b1

+ 22 - 2
hsweb-commons/hsweb-commons-service/hsweb-commons-service-api/src/main/java/org/hswebframework/web/service/QueryService.java

@@ -20,16 +20,36 @@ package org.hswebframework.web.service;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
- * TODO 完成注释
- *
+ * 查询服务接口,提供基本的查询功能
  * @author zhouhao
  * @author zhouhao
+ * @since 3.0
+ * @see QueryByEntityService
  */
  */
 public interface QueryService<E, PK> {
 public interface QueryService<E, PK> {
+
+    /**
+     * 根据主键查询
+     * @param id 主键
+     * @return 查询结果,无结果时返回{@code null}
+     */
     E selectByPk(PK id);
     E selectByPk(PK id);
 
 
+    /**
+     * 根据多个主键查询
+     * @param id 主键集合
+     * @return 查询结果,如果无结果返回空集合,而不是返回{@code null}
+     */
     List<E> selectByPk(List<PK> id);
     List<E> selectByPk(List<PK> id);
 
 
+    /**
+     * 查询所有结果
+     * @return 所有结果,如果无结果则返回空集合,而不是返回{@code null}
+     */
     List<E> select();
     List<E> select();
 
 
+    /**
+     * 查询结果总数
+     * @return 结果总数
+     */
     int count();
     int count();
 }
 }