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

org.babyfish.jimmer.sql.cache.CacheDisableConfig Maven / Gradle / Ivy

The newest version!
package org.babyfish.jimmer.sql.cache;

import org.babyfish.jimmer.meta.ImmutableProp;
import org.babyfish.jimmer.meta.ImmutableType;
import org.babyfish.jimmer.meta.TypedProp;
import org.babyfish.jimmer.sql.ImmutableProps;
import org.babyfish.jimmer.sql.ast.table.Table;

import java.util.HashSet;
import java.util.Set;
import java.util.function.Function;

public class CacheDisableConfig {

    private boolean disableAll;

    private final Set disabledTypes = new HashSet<>();

    private final Set disabledProps = new HashSet<>();

    public void disableAll() {
        disableAll = true;
    }

    public void disable(Class entityType) {
        disabledTypes.add(ImmutableType.get(entityType));
    }

    public void disable(ImmutableType type) {
        disabledTypes.add(type);
    }

    public > void disable(TypedProp prop) {
        disabledProps.add(prop.unwrap());
    }

    public void disable(ImmutableProp prop) {
        disabledProps.add(prop);
    }

    boolean isDisableAll() {
        return disableAll;
    }

    Set getDisabledTypes() {
        return disabledTypes;
    }

    Set getDisabledProps() {
        return disabledProps;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy