package com.rjconsultores.ventaboletos.dao.util;

import java.io.Serializable;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;

public class ClaseServicioGenerator implements IdentifierGenerator {
	private static final Logger log = LogManager.getLogger(ClaseServicioGenerator.class);

	@Override
	public Serializable generate(SessionImplementor session, Object object) throws HibernateException {
		// TODO Auto-generated method stub
		log.info("Inicio geração ClaseServicioID");
		Serializable nextId = ClaseServicioStore.getInstance().getNextId(session.connection());
		log.info("Fim geração ClaseServicioID:" + nextId);
		
		return nextId;
	}

}
