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

net.java.ao.builder.EntityManagerBuilderWithDatabasePropertiesAndLuceneConfiguration Maven / Gradle / Ivy

There is a newer version: 6.1.1
Show newest version
package net.java.ao.builder;

import net.java.ao.LuceneConfiguration;
import net.java.ao.SearchableEntityManager;

import java.io.IOException;

import static com.google.common.base.Preconditions.*;
import static net.java.ao.builder.DatabaseProviderFactory.*;

public final class EntityManagerBuilderWithDatabasePropertiesAndLuceneConfiguration extends AbstractEntityManagerBuilderWithDatabaseProperties
{
    private final LuceneConfiguration luceneConfiguration;

    EntityManagerBuilderWithDatabasePropertiesAndLuceneConfiguration(BuilderDatabaseProperties databaseProperties, BuilderEntityManagerConfiguration configuration, LuceneConfiguration luceneConfiguration)
    {
        super(databaseProperties, configuration);
        this.luceneConfiguration = checkNotNull(luceneConfiguration);
    }

    public SearchableEntityManager build()
    {
        try
        {
            return new SearchableEntityManager(getDatabaseProvider(getDatabaseProperties()), getEntityManagerConfiguration(), luceneConfiguration);
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy