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

com.tvd12.ezyfox.boot.util.EzyDatabaseContexts Maven / Gradle / Ivy

The newest version!
package com.tvd12.ezyfox.boot.util;

import com.tvd12.ezydata.database.EzyDatabaseContext;
import com.tvd12.ezyfox.bean.EzySingletonFactory;

import static com.tvd12.ezyfox.bean.impl.EzyBeanNameParser.getBeanName;

public final class EzyDatabaseContexts {

    private EzyDatabaseContexts() {}

    public static void addRepositoriesFromDatabaseContextToSingletonFactory(
        EzyDatabaseContext databaseContext,
        EzySingletonFactory singletonFactory
    ) {
        databaseContext
            .getRepositories()
            .forEach((repoType, repo) ->
                singletonFactory.addSingleton(getBeanName(repoType), repo)
            );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy