diff options
| author | Kevin J Hoerr <khoerr@ksmpartners.com> | 2022-01-27 14:12:29 -0500 |
|---|---|---|
| committer | Kevin J Hoerr <khoerr@ksmpartners.com> | 2022-01-27 14:12:29 -0500 |
| commit | 615c8a0fc8d2b35da7df90115456d33444104c41 (patch) | |
| tree | aeab4261b4edaf63905bd008ce6992b0d2490916 /src/main/java/dev/submelon/pantry/PantryItem.java | |
| parent | 8d8d8cdd639591c0c4c49b355db1152e310c22d6 (diff) | |
| download | pantry-615c8a0fc8d2b35da7df90115456d33444104c41.tar.gz pantry-615c8a0fc8d2b35da7df90115456d33444104c41.tar.bz2 pantry-615c8a0fc8d2b35da7df90115456d33444104c41.zip | |
Add error handling
Diffstat (limited to 'src/main/java/dev/submelon/pantry/PantryItem.java')
| -rw-r--r-- | src/main/java/dev/submelon/pantry/PantryItem.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/dev/submelon/pantry/PantryItem.java b/src/main/java/dev/submelon/pantry/PantryItem.java new file mode 100644 index 0000000..36850bf --- /dev/null +++ b/src/main/java/dev/submelon/pantry/PantryItem.java @@ -0,0 +1,40 @@ +package dev.submelon.pantry; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Entity +@Getter +@Setter +@NoArgsConstructor +public class PantryItem { + @Id + @GeneratedValue(strategy=GenerationType.AUTO) + private Integer id; + + @Column(nullable=false) + private String name; + + private String description; + + @Column(unique=true, nullable=false) + private String shortid; + + @Column(nullable=false) + private double quantity; + + public PantryItem(String name, String description, String shortid, double quantity) { + this.name = name; + this.description = description; + this.shortid = shortid; + this.quantity = quantity; + } + +} |
