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

com.github.aly8246.autoConfiguration.CollectionProperties Maven / Gradle / Ivy

Go to download

Collection Util is a mybatis plug-in designed to solve the problem of N + 1 in mysql. When you use Mysql to query linked tables and pages, there will be n + 1 problem. This plug-in can help you!

There is a newer version: 1.1.1.RELEASE
Show newest version
package com.github.aly8246.autoConfiguration;


import com.github.aly8246.collectionutil.core.PageInterface;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Properties;

/**
 * 配置文件
 *
 * @author 南有乔木
 * @version v.1.0.2
 * @see PageInterface
 */
@ConfigurationProperties(
        prefix = "collection-util"
)
@Component
public class CollectionProperties {
    private Properties properties = new Properties();
    /**
     * 零边界
     */
    private Boolean safeModel;
    /**
     * 数据库[默认:mysql]
     */
    private String database;

    public CollectionProperties() {
        this.properties.setProperty("database", "mysql");
        this.properties.setProperty("safe-model", Boolean.toString(false
        ));
    }

    public Properties getProperties() {
        return this.properties;
    }

    public Boolean getSafeModel() {
        return Boolean.valueOf(properties.getProperty("safe-model"));
    }

    public void setSafeModel(Boolean safeModel) {
        this.properties.setProperty("safe-model", safeModel.toString());
    }

    public String getDatabase() {
        return this.properties.getProperty("database");
    }

    public void setDatabase(String database) {
        this.properties.setProperty("database", database);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy