In this tutorial we will see Spring Data JPA CRUD example. Here we will use the embedded or in-memory HSQL database. For more information on HSQL, you can find here http://hsqldb.org/

In this example we will create full annotation based Spring standalone application.

You can also find another tutorial Embedded HSQL Database in Spring Application

Spring Data Repository

The central interface in Spring Data repository abstraction is Repository. It takes the the domain class to manage as well as the id type of the domain class as type arguments. This interface acts primarily as a marker interface to capture the types to work with and to help you to discover interfaces that extend this one. The CrudRepository provides sophisticated CRUD functionality for the entity class that is being managed.

For more information please read Spring Data Repository

Example

Prerequisites

Eclipse Neon
Maven 3.3.9
Spring 4.3.8.RELEASE
HSQLDB 2.2.9
Java 1.8

Maven dependency – pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>jeejava</groupId>
	<artifactId>spring-data-jpa-hsql</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>spring-data-jpa-hsql</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<jdk.version>1.8</jdk.version>
		<spring.version>4.3.8.RELEASE</spring.version>
		<logback.version>1.1.3</logback.version>
		<slf4j.version>1.7.12</slf4j.version>
		<hsqldb.version>2.2.9</hsqldb.version>
	</properties>

	<dependencies>
		<!-- spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- spring data jpa -->
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-jpa</artifactId>
			<version>1.8.2.RELEASE</version>
		</dependency>

		<!-- hibernate -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>4.3.11.Final</version>
		</dependency>

		<!-- hsqldb -->
		<dependency>
			<groupId>org.hsqldb</groupId>
			<artifactId>hsqldb</artifactId>
			<version>${hsqldb.version}</version>
		</dependency>

		<!-- slf4j logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<!-- logback -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.6.1</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

Create below logback.xml file to override Spring’s default logging mechanism and put it under src/main/resources directory

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<!-- print to console -->
	<appender name="CA" class="ch.qos.logback.core.ConsoleAppender">
		<!-- Log message format -->
		<encoder>
			<pattern>%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36} -
				%msg%n
			</pattern>
		</encoder>
	</appender>

	<!-- print to log file -->
	<appender name="RFA" class="ch.qos.logback.core.FileAppender">
		<file>spring-data-jpa-hsql.log</file>
		<encoder>
			<pattern>%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36} -
				%msg%n
			</pattern>
		</encoder>
	</appender>

	<root>
		<level value="INFO" />
		<appender-ref ref="CA" />
		<appender-ref ref="RFA" />
	</root>
</configuration>

Create below schema.sql file and put it under src/main/resources directory

DROP TABLE ProductType IF EXISTS;
 
CREATE TABLE ProductType (
    ProductTypeId integer identity primary key,
    ProductTypeName varchar(50) not null,
    ProductTypeDesc varchar(255) not null
);

DROP TABLE Product IF EXISTS;
 
CREATE TABLE Product (
    ProductId integer identity primary key,
    ProductTypeId integer,
    ProductName varchar(50) not null,
    ProductDesc varchar(255) not null,
    ProductPrice float not null
);

ALTER TABLE Product
ADD FOREIGN KEY (ProductTypeId) 
REFERENCES ProductType(ProductTypeId);

Now create below test data script test-data.sql to populate above tables and put it under src/main/resources

INSERT INTO ProductType(ProductTypeName, ProductTypeDesc) VALUES('Mobile','All kind of Mobile Products')
INSERT INTO ProductType(ProductTypeName, ProductTypeDesc) VALUES('Tab','All kind of Tab Products')
INSERT INTO ProductType(ProductTypeName, ProductTypeDesc) VALUES('Laptop','All type of Laptops')
INSERT INTO ProductType(ProductTypeName, ProductTypeDesc) VALUES('Desktop','All type of Desktops')

INSERT INTO Product(ProductTypeId, ProductName, ProductDesc, ProductPrice) VALUES((SELECT ProductTypeId FROM ProductType WHERE ProductTypeName = 'Mobile'), 'Samsung S7', 'Samsung S7 mobile', 30000.00)
INSERT INTO Product(ProductTypeId, ProductName, ProductDesc, ProductPrice) VALUES((SELECT ProductTypeId FROM ProductType WHERE ProductTypeName = 'Tab'), 'Galaxy Tab A', 'Samsung Galaxy Tab', 32000.00)
INSERT INTO Product(ProductTypeId, ProductName, ProductDesc, ProductPrice) VALUES((SELECT ProductTypeId FROM ProductType WHERE ProductTypeName = 'Laptop'), 'Lenovo Yoga', 'Lenovo Laptop', 35340.00)
INSERT INTO Product(ProductTypeId, ProductName, ProductDesc, ProductPrice) VALUES((SELECT ProductTypeId FROM ProductType WHERE ProductTypeName = 'Desktop'), 'Dell Optiplex', 'Dell Desktop', 24800.00)
INSERT INTO Product(ProductTypeId, ProductName, ProductDesc, ProductPrice) VALUES((SELECT ProductTypeId FROM ProductType WHERE ProductTypeName = 'Desktop'), 'Samsung 18.5 Slim', 'Samsung Desktop', 5010.00)

Create below entity classes

package com.jeejava.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Product")
public class Product implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ProductId")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer productId;

	@Column(name = "ProductName")
	private String productName;

	@Column(name = "ProductDesc")
	private String productDesc;

	@Column(name = "ProductPrice")
	private Double productPrice;

	@ManyToOne
	@JoinColumn(name = "productType", referencedColumnName = "ProductTypeId")
	private ProductType productType;

	public Integer getProductId() {
		return productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getProductDesc() {
		return productDesc;
	}

	public void setProductDesc(String productDesc) {
		this.productDesc = productDesc;
	}

	public Double getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(Double productPrice) {
		this.productPrice = productPrice;
	}

	public ProductType getProductType() {
		return productType;
	}

	public void setProductType(ProductType productType) {
		this.productType = productType;
	}

	@Override
	public String toString() {
		return "Product [productId=" + productId + ", productName=" + productName + ", productDesc=" + productDesc
				+ ", productPrice=" + productPrice + "]";
	}

}
package com.jeejava.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "ProductType")
public class ProductType implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ProductTypeId")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer productTypeId;

	@Column(name = "ProductTypeName")
	private String productTypeName;

	@Column(name = "ProductTypeDesc")
	private String productTypeDesc;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "productType")
	private List<Product> products;

	public Integer getProductTypeId() {
		return productTypeId;
	}

	public void setProductTypeId(Integer productTypeId) {
		this.productTypeId = productTypeId;
	}

	public String getProductTypeName() {
		return productTypeName;
	}

	public void setProductTypeName(String productTypeName) {
		this.productTypeName = productTypeName;
	}

	public String getProductTypeDesc() {
		return productTypeDesc;
	}

	public void setProductTypeDesc(String productTypeDesc) {
		this.productTypeDesc = productTypeDesc;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	@Override
	public String toString() {
		return "ProductType [productTypeId=" + productTypeId + ", productTypeName=" + productTypeName
				+ ", productTypeDesc=" + productTypeDesc + "]";
	}

}

Create below JPA repositories for performing CRUD operations

package com.jeejava.jparepo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.jeejava.model.Product;

public interface ProductRepository extends JpaRepository<Product, Integer> {

	Product findByProductId(Integer id);

	Product findByProductName(String name);

	@Modifying
	@Transactional
	@Query("UPDATE Product p SET p.productName = ?1, p.productDesc = ?2, p.productPrice = ?3"
			+ " WHERE p.productId = ?4")
	void updateProduct(String name, String desc, Double price, Integer id);

	@Modifying
	@Transactional
	@Query("DELETE FROM Product p WHERE p.productId = :id")
	void deleteProduct(@Param("id") Integer id);
}
package com.jeejava.jparepo;

import org.springframework.data.jpa.repository.JpaRepository;

import com.jeejava.model.ProductType;

public interface ProductTypeRepository extends JpaRepository<ProductType, Integer> {

	ProductType findByProductTypeId(Integer id);

	ProductType findByProductTypeName(String name);

	// if you want case insensitive
	ProductType findByProductTypeNameIgnoreCase(String name);

}

Now create below hsql database configuration file using annotation based configuration

package com.jeejava.config;

import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.Database;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableJpaRepositories(basePackages = "com.jeejava.jparepo")
@EnableTransactionManagement
public class HsqlDbConfig {

	@Bean
	public DataSource dataSource() {
		EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
		EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript("classpath:schema.sql")
				.addScript("classpath:test-data.sql").build();
		return db;
	}

	@Bean
	public EntityManagerFactory entityManagerFactory() {
		HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
		vendorAdapter.setDatabase(Database.HSQL);
		vendorAdapter.setGenerateDdl(true);
		LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
		factory.setJpaVendorAdapter(vendorAdapter);
		factory.setPackagesToScan("com.jeejava.model");
		factory.setDataSource(dataSource());
		factory.afterPropertiesSet();
		return factory.getObject();
	}

	@Bean
	public PlatformTransactionManager transactionManager() {
		JpaTransactionManager txManager = new JpaTransactionManager();
		txManager.setEntityManagerFactory(entityManagerFactory());
		return txManager;
	}

}

Create below service layer to interact with JPA repository

package com.jeejava.service;

import java.util.List;

import com.jeejava.model.Product;

public interface ProductService {

	List<Product> getAllProducts();

	Product findProductById(Integer productId);

	Product findProductByName(String productName);

	void saveProduct(Product product);

	void updateProduct(Product product);

	void deleteProduct(Product product);

}
package com.jeejava.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeejava.jparepo.ProductRepository;
import com.jeejava.model.Product;

@Service
public class ProductServiceImpl implements ProductService {

	@Resource
	private ProductRepository productRepository;

	@Override
	public List<Product> getAllProducts() {
		List<Product> products = productRepository.findAll();
		return products;
	}

	@Override
	public Product findProductById(Integer productId) {
		return productRepository.findByProductId(productId);
	}

	@Override
	public Product findProductByName(String productName) {
		return productRepository.findByProductName(productName);
	}

	@Override
	@Transactional
	public void saveProduct(Product product) {
		productRepository.save(product);
	}

	@Override
	@Transactional
	public void updateProduct(Product product) {
		productRepository.updateProduct(product.getProductName(), product.getProductDesc(), product.getProductPrice(),
				product.getProductId());
	}

	@Override
	@Transactional
	public void deleteProduct(Product product) {
		productRepository.deleteProduct(product.getProductId());
	}

}
package com.jeejava.service;

import java.util.List;

import com.jeejava.model.ProductType;

public interface ProductTypeService {

	List<ProductType> getAllProductTypes();

	ProductType findProductTypeById(Integer productTypeId);

	ProductType findProductTypeByName(String productTypeName);

	void saveProductType(ProductType productType);

	void updateProductType(ProductType productType);

	void deleteProductType(ProductType productType);

}
package com.jeejava.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeejava.jparepo.ProductTypeRepository;
import com.jeejava.model.ProductType;

@Service
public class ProductTypeServiceImpl implements ProductTypeService {

	@Resource
	private ProductTypeRepository productTypeRepository;

	@Override
	public List<ProductType> getAllProductTypes() {
		return productTypeRepository.findAll();
	}

	@Override
	public ProductType findProductTypeById(Integer productTypeId) {
		return productTypeRepository.findByProductTypeId(productTypeId);
	}

	@Override
	public ProductType findProductTypeByName(String productTypeName) {
		// return productTypeRepository.findByProductTypeName(productTypeName);
		return productTypeRepository.findByProductTypeNameIgnoreCase(productTypeName);
	}

	@Override
	@Transactional
	public void saveProductType(ProductType productType) {
		productTypeRepository.save(productType);
	}

	@Override
	@Transactional
	public void updateProductType(ProductType productType) {
		productTypeRepository.save(productType);
	}

	@Override
	@Transactional
	public void deleteProductType(ProductType productType) {
		productTypeRepository.delete(productType);
	}

}

Now create below main class to test the application

package com.jeejava.main;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;

import com.jeejava.config.AppConfig;
import com.jeejava.config.HsqlDbConfig;
import com.jeejava.model.Product;
import com.jeejava.model.ProductType;
import com.jeejava.service.ProductService;
import com.jeejava.service.ProductTypeService;

@Configuration
public class Application {

	private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);

	@Autowired
	private ProductService productService;

	@Autowired
	private ProductTypeService productTypeService;

	@SuppressWarnings("resource")
	public static void main(String[] args) {
		ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class, HsqlDbConfig.class,
				Application.class);

		Application app = context.getBean(Application.class);

		// ProductTypes
		app.getAllProductTypes();
		app.getProductTypeById();
		app.getProductTypeByName();
		app.saveProductType();
		app.getAllProductTypes();
		app.updateProductType();
		app.getAllProductTypes();
		app.deleteProductType();
		app.getAllProductTypes();

		// Products
		app.getAllProducts();
		app.getProductById();
		app.getProductByName();
		app.saveProduct();
		app.getAllProducts();
		app.updateProduct();
		app.getAllProducts();
		app.deleteProduct();
		app.getAllProducts();
	}

	private void getProductTypeById() {
		ProductType productType = productTypeService.findProductTypeById(1);
		LOGGER.info("Product Type for type id 1");
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info(productType.toString());
		LOGGER.info("-------------------------------------------------------------");
	}

	private void getProductTypeByName() {
		ProductType productType = productTypeService.findProductTypeByName("tab");
		LOGGER.info("Product Type for type name Tab");
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info(productType.toString());
		LOGGER.info("-------------------------------------------------------------");
	}

	private void saveProductType() {
		ProductType productType = new ProductType();
		productType.setProductTypeName("Software");
		productType.setProductTypeDesc("All types of sotwares");
		productTypeService.saveProductType(productType);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product Type successfully saved");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void updateProductType() {
		ProductType productType = new ProductType();
		productType.setProductTypeId(4);
		productType.setProductTypeName("Software");
		productType.setProductTypeDesc("All types of sotware products");
		productTypeService.updateProductType(productType);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product Type successfully updated");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void deleteProductType() {
		ProductType productType = new ProductType();
		productType.setProductTypeId(4);
		productTypeService.deleteProductType(productType);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product Type successfully deleted");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void getAllProductTypes() {
		List<ProductType> productTypes = productTypeService.getAllProductTypes();
		LOGGER.info("All Product Types");
		LOGGER.info("-------------------------------------------------------------");
		productTypes.forEach(pt -> LOGGER.info(pt.toString()));
		LOGGER.info("-------------------------------------------------------------");
	}

	private void getProductById() {
		Product product = productService.findProductById(1);
		LOGGER.info("Product for id 1");
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info(product.toString());
		LOGGER.info("-------------------------------------------------------------");
	}

	private void getProductByName() {
		Product product = productService.findProductByName("Samsung S7");
		LOGGER.info("Product for name Samsung S7");
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info(product.toString());
		LOGGER.info("-------------------------------------------------------------");
	}

	private void saveProduct() {
		ProductType productType = productTypeService.findProductTypeById(0);
		Product product = new Product();
		product.setProductName("Gionee P5");
		product.setProductPrice(7750d);
		product.setProductDesc("Gionee 4G Volte Mobile");
		product.setProductType(productType);
		productService.saveProduct(product);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product successfully saved");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void updateProduct() {
		Product product = productService.findProductById(5);
		product.setProductName("Gionee P5");
		product.setProductPrice(7800d);
		product.setProductDesc("Gionee 4G Volte Mobile");
		productService.updateProduct(product);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product successfully updated");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void deleteProduct() {
		Product product = productService.findProductById(5);
		productService.deleteProduct(product);
		LOGGER.info("-------------------------------------------------------------");
		LOGGER.info("Product successfully deleted");
		LOGGER.info("-------------------------------------------------------------");
	}

	private void getAllProducts() {
		List<Product> products = productService.getAllProducts();
		LOGGER.info("All Products");
		LOGGER.info("-------------------------------------------------------------");
		products.forEach(p -> LOGGER.info(p.toString()));
		LOGGER.info("-------------------------------------------------------------");
	}

}

Run the above main class and you will see the output shown as below

14-06-2017 18:01:57.349 [main] INFO  com.jeejava.main.Application -
				All Product Types
14-06-2017 18:01:57.349 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.364 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=0, productTypeName=Mobile, productTypeDesc=All kind of Mobile Products]
14-06-2017 18:01:57.365 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.365 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=2, productTypeName=Laptop, productTypeDesc=All type of Laptops]
14-06-2017 18:01:57.365 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=3, productTypeName=Desktop, productTypeDesc=All type of Desktops]
14-06-2017 18:01:57.365 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.388 [main] INFO  com.jeejava.main.Application -
				Product Type for type id 1
14-06-2017 18:01:57.389 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.389 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.389 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.400 [main] INFO  com.jeejava.main.Application -
				Product Type for type name Tab
14-06-2017 18:01:57.400 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.401 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.401 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.429 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.430 [main] INFO  com.jeejava.main.Application -
				Product Type successfully saved
14-06-2017 18:01:57.430 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.432 [main] INFO  com.jeejava.main.Application -
				All Product Types
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=0, productTypeName=Mobile, productTypeDesc=All kind of Mobile Products]
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=2, productTypeName=Laptop, productTypeDesc=All type of Laptops]
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=3, productTypeName=Desktop, productTypeDesc=All type of Desktops]
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=4, productTypeName=Software, productTypeDesc=All types of sotwares]
14-06-2017 18:01:57.433 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.464 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.464 [main] INFO  com.jeejava.main.Application -
				Product Type successfully updated
14-06-2017 18:01:57.464 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.467 [main] INFO  com.jeejava.main.Application -
				All Product Types
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=0, productTypeName=Mobile, productTypeDesc=All kind of Mobile Products]
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=2, productTypeName=Laptop, productTypeDesc=All type of Laptops]
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=3, productTypeName=Desktop, productTypeDesc=All type of Desktops]
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=4, productTypeName=Software, productTypeDesc=All types of sotware products]
14-06-2017 18:01:57.468 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.477 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.477 [main] INFO  com.jeejava.main.Application -
				Product Type successfully deleted
14-06-2017 18:01:57.478 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.480 [main] INFO  com.jeejava.main.Application -
				All Product Types
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=0, productTypeName=Mobile, productTypeDesc=All kind of Mobile Products]
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=1, productTypeName=Tab, productTypeDesc=All kind of Tab Products]
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=2, productTypeName=Laptop, productTypeDesc=All type of Laptops]
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				ProductType [productTypeId=3, productTypeName=Desktop, productTypeDesc=All type of Desktops]
14-06-2017 18:01:57.481 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.488 [main] INFO  com.jeejava.main.Application -
				All Products
14-06-2017 18:01:57.488 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				Product [productId=0, productName=Samsung S7, productDesc=Samsung S7 mobile, productPrice=30000.0]
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				Product [productId=1, productName=Galaxy Tab A, productDesc=Samsung Galaxy Tab, productPrice=32000.0]
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				Product [productId=2, productName=Lenovo Yoga, productDesc=Lenovo Laptop, productPrice=35340.0]
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				Product [productId=3, productName=Dell Optiplex, productDesc=Dell Desktop, productPrice=24800.0]
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				Product [productId=4, productName=Samsung 18.5 Slim, productDesc=Samsung Desktop, productPrice=5010.0]
14-06-2017 18:01:57.489 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.494 [main] INFO  com.jeejava.main.Application -
				Product for id 1
14-06-2017 18:01:57.494 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.495 [main] INFO  com.jeejava.main.Application -
				Product [productId=1, productName=Galaxy Tab A, productDesc=Samsung Galaxy Tab, productPrice=32000.0]
14-06-2017 18:01:57.495 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.500 [main] INFO  com.jeejava.main.Application -
				Product for name Samsung S7
14-06-2017 18:01:57.500 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.501 [main] INFO  com.jeejava.main.Application -
				Product [productId=0, productName=Samsung S7, productDesc=Samsung S7 mobile, productPrice=30000.0]
14-06-2017 18:01:57.501 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.508 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.509 [main] INFO  com.jeejava.main.Application -
				Product successfully saved
14-06-2017 18:01:57.509 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				All Products
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				Product [productId=0, productName=Samsung S7, productDesc=Samsung S7 mobile, productPrice=30000.0]
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				Product [productId=1, productName=Galaxy Tab A, productDesc=Samsung Galaxy Tab, productPrice=32000.0]
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				Product [productId=2, productName=Lenovo Yoga, productDesc=Lenovo Laptop, productPrice=35340.0]
14-06-2017 18:01:57.520 [main] INFO  com.jeejava.main.Application -
				Product [productId=3, productName=Dell Optiplex, productDesc=Dell Desktop, productPrice=24800.0]
14-06-2017 18:01:57.521 [main] INFO  com.jeejava.main.Application -
				Product [productId=4, productName=Samsung 18.5 Slim, productDesc=Samsung Desktop, productPrice=5010.0]
14-06-2017 18:01:57.521 [main] INFO  com.jeejava.main.Application -
				Product [productId=5, productName=Gionee P5, productDesc=Gionee 4G Volte Mobile, productPrice=7750.0]
14-06-2017 18:01:57.521 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.533 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.533 [main] INFO  com.jeejava.main.Application -
				Product successfully updated
14-06-2017 18:01:57.533 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				All Products
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=0, productName=Samsung S7, productDesc=Samsung S7 mobile, productPrice=30000.0]
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=1, productName=Galaxy Tab A, productDesc=Samsung Galaxy Tab, productPrice=32000.0]
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=2, productName=Lenovo Yoga, productDesc=Lenovo Laptop, productPrice=35340.0]
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=3, productName=Dell Optiplex, productDesc=Dell Desktop, productPrice=24800.0]
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=4, productName=Samsung 18.5 Slim, productDesc=Samsung Desktop, productPrice=5010.0]
14-06-2017 18:01:57.538 [main] INFO  com.jeejava.main.Application -
				Product [productId=5, productName=Gionee P5, productDesc=Gionee 4G Volte Mobile, productPrice=7800.0]
14-06-2017 18:01:57.539 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.548 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.549 [main] INFO  com.jeejava.main.Application -
				Product successfully deleted
14-06-2017 18:01:57.549 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.551 [main] INFO  com.jeejava.main.Application -
				All Products
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				Product [productId=0, productName=Samsung S7, productDesc=Samsung S7 mobile, productPrice=30000.0]
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				Product [productId=1, productName=Galaxy Tab A, productDesc=Samsung Galaxy Tab, productPrice=32000.0]
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				Product [productId=2, productName=Lenovo Yoga, productDesc=Lenovo Laptop, productPrice=35340.0]
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				Product [productId=3, productName=Dell Optiplex, productDesc=Dell Desktop, productPrice=24800.0]
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				Product [productId=4, productName=Samsung 18.5 Slim, productDesc=Samsung Desktop, productPrice=5010.0]
14-06-2017 18:01:57.552 [main] INFO  com.jeejava.main.Application -
				-------------------------------------------------------------

Thanks for reading.

Tags:

I am a professional Web developer, Enterprise Application developer, Software Engineer and Blogger. Connect me on Roy Tutorials | TwitterFacebook Google PlusLinkedin | Reddit | Email Me

Leave a Reply

Your email address will not be published. Required fields are marked *