All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rt.orm.LogicDao Maven / Gradle / Ivy

The newest version!
package com.rt.orm;

import java.io.Serializable;

/**
 * logic dao service interface
 * 注意: 这里不允许使用多态函数
 *
 * @author msc
 */
public interface LogicDao {

    /**
     * batch update
     *
     * @param entityArray     {@link com.json.JSONArray}
     * @param throwsException default false
     * @return LogicBean
     * @throws Exception Exception
     */
    String batchUpdate(String entityArray, String throwsException) throws Exception;

    /**
     * update SQL
     *
     * @param sql   sql
     * @param param param
     * @return String {@link com.rt.logic.beans.LogicBean}
     * @throws Exception Exception
     */
    String updateSQL(String sql, String param) throws Exception;

    /**
     * 批量直接执行sql如:insert/update/delete
     *
     * @param sqlMap          key=sql value=param
     * @param throwsException default false
     * @return String
     * @throws Exception Exception
     */
    String batchUpdateSQL(String sqlMap, String throwsException) throws Exception;

    /**
     * insert or update
     *
     * @param tableName is tableName
     * @param param     is entity
     * @return String {@link com.rt.logic.beans.LogicBean}
     * @throws Exception exception
     */
    String saveEntity(String tableName, String param) throws Exception;

    /**
     * insert
     *
     * @param tableName tableName
     * @param entity    entity
     * @return String LogicBean
     * @throws Exception exception
     */
    String insertEntity(String tableName, String entity) throws Exception;

    /**
     * update
     *
     * @param tableName tableName
     * @param entity    entity
     * @return String LogicBean
     * @throws Exception exception
     */
    String updateEntity(String tableName, String entity) throws Exception;

    /**
     * delete row
     *
     * @param tableName delete table name
     * @param id        pk value
     * @return String {@link com.rt.logic.beans.LogicBean}
     * @throws Exception exception
     */
    String deleteEntity(String tableName, Serializable id) throws Exception;

    /**
     * sql query
     *
     * @param sql      query
     * @param param    query param
     * @param startRow query start row
     * @param maxRow   query max return row
     * @return String {@link com.rt.logic.beans.LogicBean}
     * @throws Exception exception
     */
    String query(String sql, String param, long startRow, long maxRow) throws Exception;

    /**
     * get entity from id
     *
     * @param tableName is tableName
     * @param id        pk value
     * @return String {@link com.rt.logic.beans.LogicBean}
     * @throws Exception exception
     */
    String getEntity(String tableName, Serializable id) throws Exception;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy