Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a2eab8a

Browse files
Added Spring Data
1 parent 8348fcd commit a2eab8a

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

‎pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@
3535
<artifactId>spring-boot-starter-mail</artifactId>
3636
</dependency>
3737

38+
<dependency>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-starter-data-jpa</artifactId>
41+
</dependency>
42+
43+
<dependency>
44+
<groupId>org.postgresql</groupId>
45+
<artifactId>postgresql</artifactId>
46+
<scope>runtime</scope>
47+
</dependency>
48+
3849
<dependency>
3950
<groupId>org.springframework.boot</groupId>
4051
<artifactId>spring-boot-devtools</artifactId>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.naturalprogrammer.spring5tutorial.domain;
2+
3+
import javax.persistence.Column;
4+
import javax.persistence.Entity;
5+
import javax.persistence.GeneratedValue;
6+
import javax.persistence.Id;
7+
import javax.persistence.Table;
8+
9+
@Entity
10+
@Table(name="usr")
11+
public class User {
12+
13+
@Id
14+
@GeneratedValue
15+
private Long id;
16+
17+
@Column(nullable=false, length=250)
18+
private String email;
19+
20+
@Column(nullable=false, length=100)
21+
private String name;
22+
23+
@Column(nullable=false)
24+
private String password;
25+
26+
}

‎src/main/resources/application.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ spring.mail.properties.mail.smtp.ssl.enable = true
1111
spring.mvc.view.prefix: /WEB-INF/jsp/
1212
spring.mvc.view.suffix: .jsp
1313

14+
spring.datasource.url: jdbc:postgresql://localhost:5432/spring5tutorial
15+
spring.datasource.username: spring_user
16+
spring.datasource.password: spring
17+
spring.jpa.hibernate.ddl-auto: create

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /