Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
1,863 additions
and
689 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
/build/ | ||
/*.project | ||
/*.classpath | ||
/.settings/ | ||
/bin/ |
This file contains 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
85 changes: 85 additions & 0 deletions
85
bookstore-shared/src/main/java/com/apress/prospringmvc/bookstore/domain/Address.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package com.apress.prospringmvc.bookstore.domain; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.persistence.Embeddable; | ||
|
||
/** | ||
* A component which resembles the address of a {@link Customer} | ||
* | ||
* @author Koen Serneels | ||
*/ | ||
|
||
@Embeddable | ||
public class Address implements Serializable { | ||
|
||
private String street; | ||
private String houseNumber; | ||
private String boxNumber; | ||
private String city; | ||
private String postalCode; | ||
private String country; | ||
|
||
public Address() { | ||
super(); | ||
} | ||
|
||
public Address(Address source) { | ||
super(); | ||
this.street = source.street; | ||
this.houseNumber = source.houseNumber; | ||
this.boxNumber = source.boxNumber; | ||
this.city = source.city; | ||
this.postalCode = source.postalCode; | ||
this.country = source.country; | ||
} | ||
|
||
public String getStreet() { | ||
return this.street; | ||
} | ||
|
||
public void setStreet(String street) { | ||
this.street = street; | ||
} | ||
|
||
public String getHouseNumber() { | ||
return this.houseNumber; | ||
} | ||
|
||
public void setHouseNumber(String houseNumber) { | ||
this.houseNumber = houseNumber; | ||
} | ||
|
||
public String getBoxNumber() { | ||
return this.boxNumber; | ||
|
||
} | ||
|
||
public void setBoxNumber(String boxNumber) { | ||
this.boxNumber = boxNumber; | ||
} | ||
|
||
public String getCity() { | ||
return this.city; | ||
} | ||
|
||
public void setCity(String city) { | ||
this.city = city; | ||
} | ||
|
||
public String getPostalCode() { | ||
return this.postalCode; | ||
} | ||
|
||
public void setPostalCode(String postalCode) { | ||
this.postalCode = postalCode; | ||
} | ||
|
||
public String getCountry() { | ||
return this.country; | ||
} | ||
|
||
public void setCountry(String country) { | ||
this.country = country; | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
bookstore-shared/src/main/java/com/apress/prospringmvc/bookstore/domain/Book.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.apress.prospringmvc.bookstore.domain; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.ManyToOne; | ||
|
||
@Entity | ||
public class Book { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
|
||
private String title; | ||
private String description; | ||
private BigDecimal price; | ||
private Integer year; | ||
private String author; | ||
|
||
@ManyToOne(optional = false) | ||
private Category category; | ||
|
||
public Long getId() { | ||
return this.id; | ||
} | ||
|
||
public String getTitle() { | ||
return this.title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public String getDescription() { | ||
return this.description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public BigDecimal getPrice() { | ||
return this.price; | ||
} | ||
|
||
public void setPrice(BigDecimal price) { | ||
this.price = price; | ||
} | ||
|
||
public Integer getYear() { | ||
return this.year; | ||
} | ||
|
||
public void setYear(Integer year) { | ||
this.year = year; | ||
} | ||
|
||
public String getAuthor() { | ||
return this.author; | ||
} | ||
|
||
public void setAuthor(String author) { | ||
this.author = author; | ||
} | ||
|
||
public Category getCategory() { | ||
return this.category; | ||
} | ||
|
||
public void setCategory(Category category) { | ||
this.category = category; | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
bookstore-shared/src/main/java/com/apress/prospringmvc/bookstore/domain/Category.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.apress.prospringmvc.bookstore.domain; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
|
||
@Entity | ||
public class Category { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
|
||
private String name; | ||
|
||
public Long getId() { | ||
return this.id; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return this.name; | ||
} | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
bookstore-shared/src/main/java/com/apress/prospringmvc/bookstore/domain/Customer.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package com.apress.prospringmvc.bookstore.domain; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.persistence.Embedded; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
|
||
/** | ||
* A customer resembles an authenticated user of our system. A customer is able to submit orders. A customer is | ||
* identified by his or her username. When authenticating the user supplies its username and password. Besides | ||
* identification information we also store basic legal information such as address, firstname, lastname and email | ||
* address. | ||
* | ||
* @author Koen Serneels | ||
*/ | ||
|
||
@Entity | ||
public class Customer implements Serializable { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
|
||
private String firstName; | ||
private String lastName; | ||
|
||
@Embedded | ||
private Address address; | ||
private String emailAddress; | ||
private String username; | ||
private String password; | ||
|
||
public Long getId() { | ||
return this.id; | ||
} | ||
|
||
public String getFirstName() { | ||
return this.firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
|
||
public String getLastName() { | ||
return this.lastName; | ||
} | ||
|
||
public void setLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
|
||
public String getEmailAddress() { | ||
return this.emailAddress; | ||
} | ||
|
||
public void setEmailAddress(String emailAddress) { | ||
this.emailAddress = emailAddress; | ||
} | ||
|
||
public String getUsername() { | ||
return this.username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return this.password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public Address getAddress() { | ||
return this.address; | ||
} | ||
|
||
public void setAddress(Address address) { | ||
this.address = address; | ||
} | ||
} |
Oops, something went wrong.