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

com.easy.query.api.proxy.internal.ProxyEntityConflictThenable Maven / Gradle / Ivy

There is a newer version: 2.0.106
Show newest version
package com.easy.query.api.proxy.internal;

import com.easy.query.core.annotation.Nullable;
import com.easy.query.core.expression.lambda.SQLFuncExpression1;
import com.easy.query.core.proxy.ProxyEntity;
import com.easy.query.core.proxy.SQLSelectExpression;

/**
 * create time 2023/7/7 08:07
 * 文件说明
 *
 * @author xuejiaming
 */
public interface ProxyEntityConflictThenable,T, TChain> {

    /**
     * 存在有争议的情况下处理
     * @param updateSetSelector 选择需要更新的列 null || ()->null 表示不更新
     * @return
     * @throws com.easy.query.core.exception.EasyQueryNoPrimaryKeyException 不指定唯一约束时如果当前表没有主键报错
     */
    default TChain onConflictThen(@Nullable SQLFuncExpression1 updateSetSelector){
        return onConflictThen(updateSetSelector,null);
    }

    /**
     * 存在有争议的情况下处理
     * 如果constraintPropertySelector所在的列的值为null那么insert的时候不会生成列需要这是更新策略为ALL_COLUMNS
     
     * {@code
     *  setSQLStrategy(SQLExecuteStrategyEnum.ALL_COLUMNS)
     *                    }
     * 
* @param updateSetSelector 选择需要更新的列 null || ()->null表示不更新 * @param constraintPropertySelector null表示不指定使用主键 * @return * @throws com.easy.query.core.exception.EasyQueryNoPrimaryKeyException 不指定唯一约束时如果当前表没有主键报错 */ TChain onConflictThen(@Nullable SQLFuncExpression1 updateSetSelector,@Nullable SQLFuncExpression1 constraintPropertySelector); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy