Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Avoid unnecessary implementations of Serializable and imports.
  • Loading branch information
odrotbohm committed Nov 6, 2023
1 parent 85909bb commit 6397ce7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions src/main/java/videoshop/catalog/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import java.io.Serializable;
import java.time.LocalDateTime;

// (。◕‿◕。)
Expand All @@ -30,9 +29,7 @@

@Entity
@Table(name = "COMMENTS")
public class Comment implements Serializable {

private static final long serialVersionUID = -7114101035786254953L;
public class Comment {

// (。◕‿◕。)
// Falls man die Id nicht selber setzen will, kann die mit @GeneratedValue vom JPA-Provider generiert und gesetzt
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/videoshop/customer/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public UserAccount getUserAccount() {
public static final class CustomerIdentifier implements Identifier, Serializable {

private static final long serialVersionUID = 7740660930809051850L;
private final @SuppressWarnings("unused") UUID identifier;
private final UUID identifier;

/**
* Creates a new unique identifier for {@link Customer}s.
Expand Down
1 change: 0 additions & 1 deletion src/main/java/videoshop/customer/RegistrationForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package videoshop.customer;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;

import org.springframework.validation.Errors;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/videoshop/inventory/InventoryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package videoshop.inventory;

import org.salespointframework.inventory.InventoryItem;
import org.salespointframework.inventory.UniqueInventory;
import org.salespointframework.inventory.UniqueInventoryItem;
import org.springframework.security.access.prepost.PreAuthorize;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/videoshop/order/OrderController.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import java.util.Optional;

import org.salespointframework.catalog.Product;
import org.salespointframework.core.AbstractEntity;
import org.salespointframework.order.Cart;
import org.salespointframework.order.Order;
import org.salespointframework.order.OrderManagement;
Expand Down Expand Up @@ -130,7 +128,7 @@ String buy(@ModelAttribute Cart cart, @LoggedIn Optional<UserAccount> userAccoun
// (。◕‿◕。)
// Mit completeOrder(…) wird der Warenkorb in die Order überführt, diese wird dann bezahlt und abgeschlossen.
// Orders können nur abgeschlossen werden, wenn diese vorher bezahlt wurden.
var order = new Order(account, Cash.CASH);
var order = new Order(account.getId(), Cash.CASH);

cart.addItemsTo(order);

Expand Down

0 comments on commit 6397ce7

Please sign in to comment.