File tree Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Expand file tree Collapse file tree 5 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
5
6
+ import javax .inject .Inject ;
7
+ import javax .persistence .EntityManagerFactory ;
8
+
6
9
@ SpringBootApplication
7
10
public class Application {
8
11
Original file line number Diff line number Diff line change @@ -23,4 +23,4 @@ protected void configure(HttpSecurity http) throws Exception {
23
23
http .httpBasic ();
24
24
http .csrf ().disable ();
25
25
}
26
- }
26
+ }
Original file line number Diff line number Diff line change 8
8
public class Book {
9
9
10
10
@ Id
11
- @ GeneratedValue (strategy = GenerationType .AUTO )
11
+ @ GeneratedValue (strategy = GenerationType .SEQUENCE )
12
12
private Long id ;
13
-
14
13
private String name ;
15
14
private String description ;
16
-
17
15
@ ElementCollection (fetch = FetchType .EAGER )
18
16
@ CollectionTable (name = "tag" )
19
17
@ Column (name = "Value" )
@@ -36,10 +34,19 @@ public String getName() {
36
34
return name ;
37
35
}
38
36
37
+ public void setName (String name ) {
38
+ this .name = name ;
39
+ }
40
+
39
41
public String getDescription () {
40
42
return description ;
41
43
}
42
44
45
+ public void setDescription (String description ) {
46
+ this .description = description ;
47
+ }
48
+
49
+
43
50
public List <String > getTags () {
44
51
return tags ;
45
52
}
@@ -57,4 +64,4 @@ public String toString() {
57
64
", tags=" + tags +
58
65
'}' ;
59
66
}
60
- }
67
+ }
Original file line number Diff line number Diff line change 8
8
@ RepositoryRestResource
9
9
public interface BookRepository extends JpaRepository <Book , Long > {
10
10
List <Book > findByName (String name );
11
- }
11
+ }
Original file line number Diff line number Diff line change 4
4
active : development
5
5
# Database
6
6
datasource :
7
- driverClassName : org.postgresql.Driver
7
+ driver-class-name : org.postgresql.Driver
8
8
url : jdbc:postgresql://localhost:5432/book_db?createDatabaseIfNotExist=true
9
9
username : postgres
10
10
password : postgres
@@ -24,7 +24,6 @@ logging:
24
24
level :
25
25
org.springframework : INFO
26
26
org.hibernate : DEBUG
27
-
28
27
# Server configuration
29
28
server :
30
29
port : 8080
You can’t perform that action at this time.
0 commit comments