package com.yihu.hos.web.framework.dao;

import com.yihu.hos.web.framework.model.DataGridResult;
import com.yihu.hos.web.framework.util.sql.SqlCreator;
import org.hibernate.Query;
import org.hibernate.Session;

import java.io.IOException;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2016/8/8.
 */
public interface XSQLGeneralDAO {
    void beginTransaction() throws Exception;

    void commitTransaction() throws Exception;

    void saveEntity(Object var1) throws Exception;

    void updateEntity(Object var1) throws Exception;

    void mergeEntity(Object var1) throws Exception;

    void deleteEntity(Object var1) throws Exception;

    <T> void deleteEntity(Class<T> var1, Serializable var2) throws Exception;

    void saveOrUpdateEntity(Object var1) throws Exception;

    <T> T getEntity(Class<T> var1, Serializable var2) throws Exception;

    DataGridResult getDataGridResult(String var1, Integer var2, Integer var3) throws Exception;

    List<Map<String, Object>> queryListBySql(String var1) throws Exception;

    List<Map<String, Object>> queryListBySql(String var1, List var2) throws Exception;

    <T> List<T> queryListBySql(String var1, Class var2) throws Exception;

    <T> List<T> queryListBySql(String var1, List var2, Class var3) throws Exception;

    <T> T queryObjBySql(String var1, List var2, Class var3) throws Exception;

    <T> T queryObjBySql(String var1, Class var2) throws Exception;

    <T> T scalarBySql(String var1, Class var2) throws Exception;

    void execute(String var1) throws Exception;

    <T> List getEntityList(Class<T> var1, String var2);

    <T> List getEntityList(Class<T> var1, String var2, String var3, Integer var4, Integer var5) throws IOException;

    <T> List getEntityListByParentId(Class<T> var1, String var2, Integer var3, String var4, String var5, Integer var6, Integer var7) throws IOException;

    <T> List getList(Class<T> var1, String var2, String var3, String var4, Integer var5, Integer var6);

    <T> Integer getDataSetInt(Class<T> var1, String var2, String var3);

    <T> Object get(Class<T> var1, String var2, Object var3);

    Session getCurrentSession();

    Session openSession();

    Query getQuery(SqlCreator var1, String var2);

    Query getExeuteQuery(SqlCreator var1, String var2);

    Integer getMaxId(String var1);

    void insertBatch(List<String> var1);

    List getListByIdList(Class var1, String var2, String var3, List<Integer> var4);
}
