com.cherokeesoft.db.utils.api.InsertModelDao Maven / Gradle / Ivy
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();
}
}