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

com.github.lontime.extcopper.impl.DefaultRdbmsEngineFactory Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.github.lontime.extcopper.impl;

import java.util.Optional;

import com.github.lontime.extcopper.configuration.PersitenceOption;
import org.copperengine.core.DependencyInjector;
import org.copperengine.core.util.PojoDependencyInjector;

/**
 * PojoRdbmsEngineFactory.
 * @author lontime
 * @since 1.0
 */
public class DefaultRdbmsEngineFactory extends AbstractRdbmsEngineFactory {

    private DependencyInjector dependencyInjector;

    public DefaultRdbmsEngineFactory(PersitenceOption option, DependencyInjector dependencyInjector) {
        super(option);
        this.dependencyInjector = dependencyInjector;
    }

    public DefaultRdbmsEngineFactory(PersitenceOption option) {
        this(option, new PojoDependencyInjector());
    }

    @Override
    protected DependencyInjector createDependencyInjector() {
        return Optional.ofNullable(dependencyInjector).orElse(new PojoDependencyInjector());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy