Package me.prettyprint.hom

Source Code of me.prettyprint.hom.CassandraPersistenceProvider

package me.prettyprint.hom;

import org.apache.openjpa.persistence.EntityManagerFactoryImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.EntityManagerFactory;
import javax.persistence.spi.PersistenceProvider;
import javax.persistence.spi.PersistenceUnitInfo;
import java.util.Map;

/**
* This is a temporary hack : this class is needed at startup by the HOM configuration,
* but is not provided (and anyway HOM doesn't use it...).
*/
public class CassandraPersistenceProvider implements PersistenceProvider {
    private static final Logger log = LoggerFactory.getLogger(CassandraPersistenceProvider.class);

    private Map<String, Object> defProperties;

    public CassandraPersistenceProvider() {
    }

    public CassandraPersistenceProvider(Map<String, Object> map) {
        this.defProperties = map;
    }

    @Override
    public EntityManagerFactory createContainerEntityManagerFactory(
            PersistenceUnitInfo info, Map map) {
        log.debug("creating EntityManagerFactory {} with properties {} ", null, map);
        return null;
    }

    @Override
    public EntityManagerFactory createEntityManagerFactory(String emName, Map map) {
        log.debug("creating EntityManagerFactory {} with properties {} ", emName, map);
        if (map == null || map.isEmpty()) {
            return new EntityManagerFactoryImpl();
        }
        return new EntityManagerFactoryImpl();
    }

}
TOP

Related Classes of me.prettyprint.hom.CassandraPersistenceProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.