/**
 * Copyright (c) 2013 Cangol
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License")
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package mobi.cangol.mobile.db;


import android.database.SQLException;

import java.util.Collection;
import java.util.List;

public abstract interface Dao<T, ID> {
    /**
     * 条件查询
     *
     * @param queryBuilder
     * @return
     * @throws SQLException
     */
    public abstract List<T> query(QueryBuilder queryBuilder) throws SQLException;

    /**
     * 根据K查询
     *
     * @param paramK
     * @return
     * @throws SQLException
     */
    public abstract T queryForId(ID paramK) throws SQLException;

    /**
     * 查询所有
     *
     * @return
     * @throws SQLException
     */
    public abstract List<T> queryForAll() throws SQLException;

    /**
     * 新建一个数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract int create(T paramT) throws SQLException;

    /**
     * 新建一组数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract int create(Collection<T> paramT) throws SQLException;

    /**
     * 刷新数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract T refresh(T paramT) throws SQLException;

    /**
     * 更新数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract int update(T paramT) throws SQLException;

    /**
     * 更新数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract int update(Collection<T> paramT) throws SQLException;

    /**
     * 更新数据对象根据
     *
     * @param paramT
     * @param paramID
     * @return
     * @throws SQLException
     */
    public abstract int updateById(T paramT, ID paramID) throws SQLException;

    /**
     * 根据条件删除
     *
     * @param deleteBuilder
     * @return
     * @throws SQLException
     */
    public abstract int delete(DeleteBuilder deleteBuilder) throws SQLException;

    /**
     * 删除数据对象
     *
     * @param paramT
     * @return
     * @throws SQLException
     */
    public abstract int delete(T paramT) throws SQLException;

    /**
     * 删除数据对象集合
     *
     * @param paramCollection
     * @return
     * @throws SQLException
     */
    public abstract int delete(Collection<T> paramCollection) throws SQLException;

    /**
     * 更具K删除
     *
     * @param paramID
     * @return
     * @throws SQLException
     */
    public abstract int deleteById(ID paramID) throws SQLException;

    /**
     * 根据K列表执行删除
     *
     * @param paramCollection
     * @return
     * @throws SQLException
     */
    public abstract int deleteByIds(Collection<ID> paramCollection) throws SQLException;

    /**
     * 清空表删
     *
     * @throws SQLException
     */
    public abstract int deleteAll() throws SQLException;

    /**
     * 获取实体类
     *
     * @return
     */
    public abstract Class<T> getEntityClass();

}

@@ -832,44 +832,16 @@
 urn%0A
-     * @throws SQLException%0A
      */%0A
     
@@ -828,32 +828,32 @@
 @return%0A     */%0A
+
     public abstr
@@ -987,36 +987,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1103,36 +1103,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1242,36 +1242,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1380,36 +1380,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1528,36 +1528,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1663,36 +1663,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1799,36 +1799,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -1971,36 +1971,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2130,36 +2130,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2285,36 +2285,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2432,36 +2432,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2589,36 +2589,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2743,36 +2743,8 @@
 urn%0A
-     * @throws SQLException%0A
     
@@ -2861,43 +2861,15 @@
 %E7%A9%BA%E8%A1%A8%E5%88%A0%0A
+
      *%0A
-     * @throws SQLException%0A
     

update dao