Browse Source

Prefer 'Long' over 'long' data type for Ids

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.1-alpha
Pekka Helenius 4 years ago
parent
commit
a479b461e8
3 changed files with 9 additions and 9 deletions
  1. +3
    -3
      bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java
  2. +3
    -3
      bookstore/src/main/java/com/fjordtek/bookstore/model/Category.java
  3. +3
    -3
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java

+ 3
- 3
bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java View File

@ -73,7 +73,7 @@ public class Book {
name = "bookIdGenerator",
sequenceName = "bookIdSequence"
)
private long id;
private Long id;
////////////////////
// Attributes with hard-coded constraints
@ -170,7 +170,7 @@ public class Book {
// TODO consider accessibility restrictions?
// NOTE: in default scenario, this is automatically generated
public void setId(long id) {
public void setId(Long id) {
this.id = id;
}
@ -203,7 +203,7 @@ public class Book {
// TODO consider accessibility restrictions?
public long getId() {
public Long getId() {
return id;
}


+ 3
- 3
bookstore/src/main/java/com/fjordtek/bookstore/model/Category.java View File

@ -25,7 +25,7 @@ public class Category {
name = "categoryIdGenerator",
sequenceName = "categoryIdSequence"
)
private long id;
private Long id;
////////////////////
// Attributes with hard-coded constraints
@ -41,7 +41,7 @@ public class Category {
////////////////////
// Attribute setters
public void setId(long id) {
public void setId(Long id) {
this.id = id;
}
@ -56,7 +56,7 @@ public class Category {
////////////////////
// Attribute getters
public long getId() {
public Long getId() {
return id;
}


+ 3
- 3
bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java View File

@ -124,7 +124,7 @@ public class BookController {
method = RequestMethod.GET
)
public String webFormDeleteBook(
@PathVariable("id") long bookId,
@PathVariable("id") Long bookId,
HttpServletRequest requestData
) {
@ -146,7 +146,7 @@ public class BookController {
method = { RequestMethod.GET }
)
public String webFormEditBook(
@PathVariable("id") long bookId,
@PathVariable("id") Long bookId,
Model dataModel,
HttpServletRequest requestData
) {
@ -177,7 +177,7 @@ public class BookController {
public String webFormUpdateBook(
@Valid @ModelAttribute("book") Book book,
BindingResult bindingResult,
@PathVariable("id") long bookId,
@PathVariable("id") Long bookId,
HttpServletRequest requestData
) {


Loading…
Cancel
Save