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

com.itranswarp.rdb.DeleteT Maven / Gradle / Ivy

package com.itranswarp.rdb;

public class DeleteT {

    final DeleteInfo deleteInfo;

    DeleteT(DeleteInfo deleteInfo, Class beanClass) {
        deleteInfo.beanClass = beanClass;
        deleteInfo.beanMapper = Mappers.getMapper(beanClass);
        deleteInfo.table = deleteInfo.beanMapper.table;
        deleteInfo.primaryKey = deleteInfo.beanMapper.primaryKey;
        this.deleteInfo = deleteInfo;
    }

    /**
     * Batch delete the beans.
     * 
     * @param beans JavaBean objects.
     */
    public void runBatch(@SuppressWarnings("unchecked") T... beans) {
        if (beans.length == 0) {
            throw new IllegalArgumentException("objects is empty.");
        }
        this.deleteInfo.beans = beans;
        new DeleteRunner(this.deleteInfo).run();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy