All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vanillabp.springboot.utils.JpaSpringDataUtilConfiguration Maven / Gradle / Ivy

There is a newer version: 1.1.3
Show newest version
package io.vanillabp.springboot.utils;

import io.vanillabp.springboot.adapter.SpringDataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.JpaContext;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;

@Configuration
@ConditionalOnMissingBean(SpringDataUtil.class)
public class JpaSpringDataUtilConfiguration {

    @Autowired
    private ApplicationContext applicationContext;

    @Autowired
    private LocalContainerEntityManagerFactoryBean containerEntityManagerFactoryBean;

    @Autowired
    private JpaContext jpaContext;
    
    @Bean
    public SpringDataUtil jpaSpringDataUtil() {
       
        return new JpaSpringDataUtil(
                applicationContext,
                jpaContext,
                containerEntityManagerFactoryBean);
        
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy