org.javastro.ivoa.entities.regtap.AbstractPersistenceManager Maven / Gradle / Ivy
/*
* Created on 16 May 2019
* Copyright 2019 Paul Harrison ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License in file LICENSE
*/
package org.javastro.ivoa.entities.regtap;
import java.util.HashMap;
import java.util.Map;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Persistence;
/**
* Persistence Manager for RegTap db.
* @author Paul Harrison ([email protected])
* @since 16 May 2019
*/
public abstract class AbstractPersistenceManager {
private static final String PU = "org.javastro.ivoa.entities.regtap_pu";
protected Map props = new HashMap<>();
/**
* set connection properties in the props map;
*/
abstract void setupConnectionProperties();
public EntityManagerFactory createEmf()
{
setupConnectionProperties();
return Persistence.createEntityManagerFactory(PU, props);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy