This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server.port=8090 | |
| #spring.h2.console.enabled=true | |
| spring.jpa.show-sql=true | |
| spring.jpa.hibernate.ddl-auto=none | |
| spring.datasource.url=jdbc:mysql://localhost:3306/person_example | |
| spring.datasource.username=personuser | |
| spring.datasource.password=YOUR_PASSWORD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.database.databasedemo; | |
| import java.util.Date; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.CommandLineRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.database.databasedemo.springdata; | |
| import org.springframework.data.jpa.repository.JpaRepository; | |
| import com.pig.database.databasedemo.entity.Person; | |
| public interface PersonSpringDataRepository extends JpaRepository<Person, Integer>{ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| create table person | |
| ( | |
| id integer not null, | |
| name varchar (255) not null, | |
| location varchar(255), | |
| birth_date timestamp, | |
| primary key(id) | |
| ); | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.database.databasedemo.entity; | |
| import java.util.Date; | |
| import javax.persistence.Entity; | |
| import javax.persistence.GeneratedValue; | |
| import javax.persistence.Id; | |
| import javax.persistence.NamedQuery; | |
| import javax.persistence.Table; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| create table person | |
| ( | |
| id integer not null, | |
| name varchar (255) not null, | |
| location varchar(255), | |
| birth_date timestamp, | |
| primary key(id) | |
| ); | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.database.databasedemo.springdata; | |
| import java.util.List; | |
| import org.springframework.data.jpa.repository.JpaRepository; | |
| import org.springframework.data.jpa.repository.Query; | |
| import com.pig.database.databasedemo.entity.Person; | |
| public interface PersonSpringDataRepository extends JpaRepository<Person, Integer>{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.pig.database.databasedemo; | |
| import java.util.Date; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.CommandLineRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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>com.pig</groupId> | |
| <artifactId>first-web-application</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> | |
| <packaging>war</packaging> | |
| <dependencies> | |
| <dependency> | |
| <groupId>javax</groupId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> | |
| <display-name>first-web-application</display-name> | |
| <welcome-file-list> | |
| <welcome-file>index.html</welcome-file> | |
| <welcome-file>index.htm</welcome-file> | |
| <welcome-file>index.jsp</welcome-file> | |
| <welcome-file>default.html</welcome-file> | |
| <welcome-file>default.htm</welcome-file> | |
| <welcome-file>default.jsp</welcome-file> |