Skip to content

Commit 477e3b3

Browse files
committed
Updated Book.java
1 parent a6bb2e4 commit 477e3b3

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

src/main/java/com/kaluzny/Application.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
55

6+
import javax.inject.Inject;
7+
import javax.persistence.EntityManagerFactory;
8+
69
@SpringBootApplication
710
public class Application {
811

src/main/java/com/kaluzny/config/SecurityConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ protected void configure(HttpSecurity http) throws Exception {
2323
http.httpBasic();
2424
http.csrf().disable();
2525
}
26-
}
26+
}

src/main/java/com/kaluzny/domain/Book.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
public class Book {
99

1010
@Id
11-
@GeneratedValue(strategy = GenerationType.AUTO)
11+
@GeneratedValue(strategy = GenerationType.SEQUENCE)
1212
private Long id;
13-
1413
private String name;
1514
private String description;
16-
1715
@ElementCollection(fetch = FetchType.EAGER)
1816
@CollectionTable(name = "tag")
1917
@Column(name = "Value")
@@ -36,10 +34,19 @@ public String getName() {
3634
return name;
3735
}
3836

37+
public void setName(String name) {
38+
this.name = name;
39+
}
40+
3941
public String getDescription() {
4042
return description;
4143
}
4244

45+
public void setDescription(String description) {
46+
this.description = description;
47+
}
48+
49+
4350
public List<String> getTags() {
4451
return tags;
4552
}
@@ -57,4 +64,4 @@ public String toString() {
5764
", tags=" + tags +
5865
'}';
5966
}
60-
}
67+
}

src/main/java/com/kaluzny/domain/BookRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
@RepositoryRestResource
99
public interface BookRepository extends JpaRepository<Book, Long> {
1010
List<Book> findByName(String name);
11-
}
11+
}

src/main/resources/application.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ spring:
44
active: development
55
# Database
66
datasource:
7-
driverClassName: org.postgresql.Driver
7+
driver-class-name: org.postgresql.Driver
88
url: jdbc:postgresql://localhost:5432/book_db?createDatabaseIfNotExist=true
99
username: postgres
1010
password: postgres
@@ -24,7 +24,6 @@ logging:
2424
level:
2525
org.springframework: INFO
2626
org.hibernate: DEBUG
27-
2827
# Server configuration
2928
server:
3029
port: 8080

0 commit comments

Comments
 (0)