Search in sources :

Example 1 with ProductRepository

use of com.zavada.repository.ProductRepository in project Logos_Materials_October_2017 by VolodymyrZavada.

the class SpringBootConsultationProjectApplication method addProducts.

static void addProducts(ConfigurableApplicationContext context) {
    ProductRepository productRepository = context.getBean(ProductRepository.class);
    ProductEntity product = productRepository.findOne(1);
    if (product == null) {
        productRepository.save(getProducts());
    }
}
Also used : ProductRepository(com.zavada.repository.ProductRepository) ProductEntity(com.zavada.entity.ProductEntity)

Aggregations

ProductEntity (com.zavada.entity.ProductEntity)1 ProductRepository (com.zavada.repository.ProductRepository)1