com.speedment.jpastreamer.integration.cdi.JPAStreamerProducer Maven / Gradle / Ivy
/*
* JPAstreamer - Express JPA queries with Java Streams
* Copyright (c) 2020-2022, Speedment, Inc. All Rights Reserved.
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* See: https://github.com/speedment/jpa-streamer/blob/master/LICENSE
*/
package com.speedment.jpastreamer.integration.cdi;
import com.speedment.jpastreamer.application.JPAStreamer;
import jakarta.persistence.EntityManagerFactory;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
/**
* A CDI class that adds support for JPAStreamer injection.
*
* @author Romain PETIT
* @since 1.0.2
*/
@ApplicationScoped
public class JPAStreamerProducer {
@Produces
JPAStreamer jpaStreamer(EntityManagerFactory entityManagerFactory) {
return JPAStreamer.createJPAStreamerBuilder(entityManagerFactory).build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy