JR Utily

fix the big issue regarding transaction at startup

package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
@Eager
public interface AccountAttributeRepository extends JpaRepository<AccountAttribute, Integer> {
}
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
@Eager
public interface AccountPropertyRepository extends JpaRepository<AccountProperty, Integer> {
}
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
import java.util.List;
@Eager
public interface AccountRepository extends JpaRepository<Account, Integer> {
/**
*
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
@Eager
public interface AccountRoleRepository extends JpaRepository<AccountRole, Integer> {
}
\ No newline at end of file
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
@Eager
public interface CountryRepository extends JpaRepository<Country, Integer> {
}
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
import java.util.List;
/**
* Interface for accessing PublisherAction
*/
@Eager
public interface PublisherActionRepository extends JpaRepository<PublisherAction, Integer> {
/**
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
import java.util.List;
@Eager
public interface PublisherRepository extends JpaRepository<Publisher, Integer> {
List<Publisher> findByValidatedVersionIsNotNull();
}
......
package org.legrog.entities;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.cdi.Eager;
import java.util.List;
@Eager
public interface PublisherVersionRepository extends JpaRepository<PublisherVersion, Integer> {
/**
*
......
package org.legrog.configuration;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Disposes;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
......@@ -18,17 +17,9 @@ public class EntityManagerProducer {
/**
* Injectable interface for persistence handling
*/
@Produces
@RequestScoped
@Produces @Dependent
@PersistenceContext(unitName = "Grog-DB")
public EntityManager entityManager;
public void closeEntityManager(@Disposes EntityManager entityManager) {
if (entityManager.isOpen()) {
entityManager.close();
}
}
}
......