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

org.babyfish.jimmer.sql.ast.mutation.SimpleEntitySaveCommand Maven / Gradle / Ivy

There is a newer version: 0.9.19
Show newest version
package org.babyfish.jimmer.sql.ast.mutation;

import org.babyfish.jimmer.lang.NewChain;
import org.babyfish.jimmer.meta.ImmutableProp;
import org.babyfish.jimmer.meta.TypedProp;
import org.babyfish.jimmer.sql.DissociateAction;
import org.babyfish.jimmer.sql.TargetTransferMode;
import org.babyfish.jimmer.sql.ast.Executable;
import org.babyfish.jimmer.sql.ast.table.Table;
import org.babyfish.jimmer.sql.runtime.ExceptionTranslator;

import java.util.Collection;

public interface SimpleEntitySaveCommand
        extends Executable>,
        AbstractEntitySaveCommand {

    @NewChain
    @Override
    SimpleEntitySaveCommand setMode(SaveMode mode);

    @NewChain
    @Override
    SimpleEntitySaveCommand setAssociatedModeAll(AssociatedSaveMode mode);

    @NewChain
    @Override
    SimpleEntitySaveCommand setAssociatedMode(ImmutableProp prop, AssociatedSaveMode mode);

    @NewChain
    @Override
    default SimpleEntitySaveCommand setAssociatedMode(TypedProp.Association prop, AssociatedSaveMode mode) {
        return setAssociatedMode(prop.unwrap(), mode);
    }

    @NewChain
    @Override
    SimpleEntitySaveCommand setKeyProps(ImmutableProp... props);

    @NewChain
    @Override
    default SimpleEntitySaveCommand setKeyProps(TypedProp... props) {
        ImmutableProp[] unwrappedProps = new ImmutableProp[props.length];
        for (int i = 0; i < props.length; i++) {
            unwrappedProps[i] = props[i].unwrap();
        }
        return setKeyProps(unwrappedProps);
    }

    @NewChain
    @Override
    SimpleEntitySaveCommand setAutoIdOnlyTargetCheckingAll();

    @NewChain
    @Override
    default SimpleEntitySaveCommand setAutoIdOnlyTargetChecking(TypedProp.Association prop) {
        return setAutoIdOnlyTargetChecking(prop.unwrap());
    }

    @NewChain
    @Override
    default SimpleEntitySaveCommand setAutoIdOnlyTargetChecking(TypedProp.Association prop, boolean checking) {
        return setAutoIdOnlyTargetChecking(prop.unwrap(), checking);
    }

    @NewChain
    @Override
    default SimpleEntitySaveCommand setAutoIdOnlyTargetChecking(ImmutableProp prop) {
        return setAutoIdOnlyTargetChecking(prop, true);
    }

    @NewChain
    @Override
    SimpleEntitySaveCommand setAutoIdOnlyTargetChecking(ImmutableProp prop, boolean checking);

    @NewChain
    @Override
    default SimpleEntitySaveCommand setDissociateAction(
            TypedProp.Reference prop,
            DissociateAction dissociateAction
    ) {
        return setDissociateAction(prop.unwrap(), dissociateAction);
    }

    @NewChain
    @Override
    SimpleEntitySaveCommand setDissociateAction(
            ImmutableProp prop,
            DissociateAction dissociateAction
    );

    @NewChain
    @Override
    default SimpleEntitySaveCommand setTargetTransferMode(
            TypedProp.ReferenceList prop,
            TargetTransferMode mode
    ) {
        return setTargetTransferMode(prop.unwrap(), mode);
    }

    @NewChain
    @Override
    SimpleEntitySaveCommand setTargetTransferMode(
            ImmutableProp prop,
            TargetTransferMode mode
    );

    @NewChain
    @Override
    SimpleEntitySaveCommand setTargetTransferModeAll(TargetTransferMode mode);

    @NewChain
    @Override
    SimpleEntitySaveCommand setLockMode(LockMode lockMode);

    @NewChain
    > SimpleEntitySaveCommand setOptimisticLock(
            Class tableType,
            UserOptimisticLock block
    );

    @NewChain
    @Override
    SimpleEntitySaveCommand setDeleteMode(DeleteMode mode);

    @NewChain
    @Override
    SimpleEntitySaveCommand addExceptionTranslator(ExceptionTranslator translator);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy