Package factoryImpl

Source Code of factoryImpl.RdbDaoFactory

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package factoryImpl;

import dao.ClientDAO;
import dao.ReservationDetailsDAO;
import factoryInterface.RdbDaoFactoryInterface;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import managedbeans.Client;
import managedbeans.ReservationDetails;

/**
*
* @author Corina
*/
public class RdbDaoFactory implements RdbDaoFactoryInterface{

    private static final RdbDaoFactory rdbDaoFactory = new RdbDaoFactory();
    private RdbDaoFactory(){}
    public static RdbDaoFactory getRdbDaoFactoryInstance(){
        return rdbDaoFactory;
    }
    @Override
    public EntityManagerFactory getEntityManagerFactory() {
         return Persistence.createEntityManagerFactory("RestaurantReservationsPostgresPU");
    }
    public static ClientDAO getClientDAO(Client client){
        return new ClientDAO(client);
    }
    public static ClientDAO getClientDAO(){
        return new ClientDAO();
    }
    public static ReservationDetailsDAO getReservationDetailsDAO(ReservationDetails reservationDetails){
        return new ReservationDetailsDAO(reservationDetails);
    }
    public static ReservationDetailsDAO getReservationDetailsDAO(){
        return new ReservationDetailsDAO();
    }
}
TOP

Related Classes of factoryImpl.RdbDaoFactory

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.