


In this package create new interface named ProductService.java as below: package Public List BigDecimal min, BigDecimal max) Ĭreate new package named. Public class Product implements Serializable ", nativeQuery = true) In this package, create new java class named Product.java as below: package Open application.properties file in src/main/resources folder and add configurations connect to database as below: = jdbc:mysql://localhost:3306/springbootdatajpaĬreate new package named. SELECT * FROM product where price BETWEEN min and max INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Laptop 3', '2.0', 15, 'description 9', 'thumb2.gif', 0) ĬREATE PROCEDURE sp_findBetween(min decimal, max decimal) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Laptop 2', '4.0', 11, 'description 8', 'thumb3.gif', 1) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Laptop 1', '3.0', 8, 'description 7', 'thumb2.gif', 0) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Computer 3', '12.0', 2, 'description 6', 'thumb2.gif', 1) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Computer 2', '7.0', 5, 'description 5', 'thumb1.gif', 0)

INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Computer 1', '5.0', 12, 'description 4', 'thumb1.gif', 1)

INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Mobile 3', '3.0', 9, 'description 3', 'thumb3.gif', 0) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Mobile 2', '1.0', 5, 'description 2', 'thumb2.gif', 1) INSERT INTO `product` (`name`, `price`, `quantity`, `description`, `photo`, `featured`) VALUES('Mobile 1', '2.0', 2, 'description 1', 'thumb1.gif', 0) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci `photo` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL, `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, Select the technologies and libraries to be used:Ĭlick Next button to show Site Information for projectĬlick Finish button to finish create Spring Boot projectĬreate a database with the name is springbootdatajpa. On the Eclipse, create a Spring Boot project
