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

com.cherokeesoft.db.utils.api.InsertModelDao Maven / Gradle / Ivy

There is a newer version: 1.8.29
Show newest version
package com.cherokeesoft.db.utils.api;


import com.cherokeesoft.db.utils.exception.DataException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

@Deprecated
public interface InsertModelDao {
    List batchInsert(List models) throws DataException;

    default ID insert(MODEL model) throws DataException {
        List ids = batchInsert(Arrays.asList(model));
        return CollectionUtils.isEmpty(ids) ? null : ids.iterator().next();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy