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

com.github.fartherp.framework.database.dao.DaoMapper Maven / Gradle / Ivy

There is a newer version: 3.0.6
Show newest version
/*
 * Copyright (C) 2018 hyssop, Inc. All Rights Reserved.
 */

/*
 * Copyright (c) 2017. CK. All rights reserved.
 */

package com.github.fartherp.framework.database.dao;

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

/**
 * insert、delete、update、select method SQL of XML Mapper file
 * Author: CK
 * Date: 2015/6/5.
 */
public interface DaoMapper {
    /**
     * delete action by primary key
     *
     * @param id primary key
     * @return delete result. 1 means success
     */
    int deleteByPrimaryKey(ID id);

    /**
     * do insert entity
     *
     * @param record entity bean to insert
     * @return insert result 1 means success
     */
    int insert(T record);

    /**
     * do insert entity ignore null property
     *
     * @param record entity bean to insert
     * @return insert result 1 means success
     */
    int insertSelective(T record);

    /**
     * find entity by primary key
     *
     * @param id primary key
     * @return entity bean
     */
    T selectByPrimaryKey(ID id);

    /**
     * update entity by primary key ignore null property
     *
     * @param record entity bean
     * @return effective count
     */
    int updateByPrimaryKeySelective(T record);

    /**
     * update entity by primary key
     *
     * @param record entity bean
     * @return effective count
     */
    int updateByPrimaryKey(T record);

    /**
     * do select count(*) mapped id
     *
     * @return record count
     */
    long count();

    /**
     * find all records
     *
     * @return all records
     */
    List selectAll();

    /**
     * save batch
     */
    void insertBatch(List list);

    /**
     * delete batch
     * @param ids ids
     */
    void deleteBatch(ID... ids);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy