From 2d69b2f9182a8e4f34a86c5f2749fe58c55edfa5 Mon Sep 17 00:00:00 2001 From: Markus Kreth Date: Wed, 13 Jul 2022 23:25:43 +0200 Subject: [PATCH] Fixed gitignore --- .gitignore | 2 +- .../java/de/kreth/invoice/data/SportArt.java | 70 +++++++++++++++++++ .../de/kreth/invoice/data/SportStaette.java | 69 ++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 src/main/java/de/kreth/invoice/data/SportArt.java create mode 100644 src/main/java/de/kreth/invoice/data/SportStaette.java diff --git a/.gitignore b/.gitignore index 67874b8..5d1d28e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ frontend/generated/ node_modules/ -data/ +h2/ images/ diff --git a/src/main/java/de/kreth/invoice/data/SportArt.java b/src/main/java/de/kreth/invoice/data/SportArt.java new file mode 100644 index 0000000..14a901f --- /dev/null +++ b/src/main/java/de/kreth/invoice/data/SportArt.java @@ -0,0 +1,70 @@ +package de.kreth.invoice.data; + +import java.util.Objects; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "SPORTART") +public class SportArt extends BaseEntity { + + private static final long serialVersionUID = 9087707740670720452L; + + @Column(nullable = false, name = "user_id") + private long userId; + + @Column(nullable = false, length = 50) + private String name; + + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + protected String getMediumRepresentation() { + return name; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + Objects.hash(name, userId); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + SportArt other = (SportArt) obj; + return Objects.equals(name, other.name) && userId == other.userId; + } + + @Override + public String toString() { + return "SportArt [getId()=" + getId() + ", userId=" + userId + ", name=" + name + "]"; + } + +} diff --git a/src/main/java/de/kreth/invoice/data/SportStaette.java b/src/main/java/de/kreth/invoice/data/SportStaette.java new file mode 100644 index 0000000..d558544 --- /dev/null +++ b/src/main/java/de/kreth/invoice/data/SportStaette.java @@ -0,0 +1,69 @@ +package de.kreth.invoice.data; + +import java.util.Objects; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "SPORTSTAETTE") +public class SportStaette extends BaseEntity { + + private static final long serialVersionUID = 9087707740670720452L; + @Column(nullable = false, name = "user_id") + private long userId; + + @Column(nullable = false, length = 50) + private String name; + + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + protected String getMediumRepresentation() { + return name; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + Objects.hash(name, userId); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + SportStaette other = (SportStaette) obj; + return Objects.equals(name, other.name) && userId == other.userId; + } + + @Override + public String toString() { + return "SportStaette [getId()=" + getId() + ", userId=" + userId + ", name=" + name + "]"; + } + +}