diff --git a/.classpath b/.classpath index 02f8680..9bc1b29 100644 --- a/.classpath +++ b/.classpath @@ -6,6 +6,7 @@ + @@ -27,14 +28,15 @@ + + - diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index d301b14..1ae503a 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -10,7 +11,8 @@ - + + @@ -21,7 +23,8 @@ - + + @@ -32,7 +35,8 @@ - + + @@ -43,7 +47,8 @@ - + + @@ -54,9 +59,12 @@ - + + - + + + @@ -67,7 +75,8 @@ - + + @@ -78,7 +87,8 @@ - + + @@ -89,7 +99,8 @@ - + + diff --git a/pom.xml b/pom.xml index 81b39c6..1cf8b6f 100644 --- a/pom.xml +++ b/pom.xml @@ -122,12 +122,6 @@ libphonenumber 8.10.4 - - org.projectlombok - lombok - 1.18.8 - - org.springframework.boot diff --git a/src/main/java/Main.java b/src/main/java/Main.java new file mode 100644 index 0000000..8d301e9 --- /dev/null +++ b/src/main/java/Main.java @@ -0,0 +1,21 @@ +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.SQLException; + +import com.mysql.cj.jdbc.MysqlDataSource; + +public class Main { + + public static void main(String[] args) throws SQLException { + MysqlDataSource dataSource = new MysqlDataSource(); + dataSource.setUrl( + "jdbc:mysql://localhost:3306/clubhelper?useSSL=FALSE&useUnicode=yes&characterEncoding=utf8&serverTimezone=UTC"); + dataSource.setUser("root"); + dataSource.setPassword("07!73"); + try (Connection conn = dataSource.getConnection()) { + DatabaseMetaData meta = conn.getMetaData(); + System.out.println(meta); + } + } + +} diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Adress.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Adress.java index d811909..308fccf 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Adress.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Adress.java @@ -9,9 +9,6 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the adress database table. * @@ -20,8 +17,7 @@ import lombok.EqualsAndHashCode; @Table(name = "adress") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Adress.findAll", query = "SELECT a FROM Adress a") -@EqualsAndHashCode(callSuper = true) -public @Data class Adress extends BaseEntity implements Serializable { +public class Adress extends BaseEntity implements Serializable { private static final long serialVersionUID = 8216273166570667412L; @@ -37,6 +33,113 @@ public @Data class Adress extends BaseEntity implements Serializable { @ManyToOne private Person person; + public String getAdress1() { + return adress1; + } + + public void setAdress1(String adress1) { + this.adress1 = adress1; + } + + public String getAdress2() { + return adress2; + } + + public void setAdress2(String adress2) { + this.adress2 = adress2; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPlz() { + return plz; + } + + public void setPlz(String plz) { + this.plz = plz; + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((adress1 == null) ? 0 : adress1.hashCode()); + result = prime * result + ((adress2 == null) ? 0 : adress2.hashCode()); + result = prime * result + ((city == null) ? 0 : city.hashCode()); + result = prime * result + ((person == null) ? 0 : person.hashCode()); + result = prime * result + ((plz == null) ? 0 : plz.hashCode()); + 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; + } + Adress other = (Adress) obj; + if (adress1 == null) { + if (other.adress1 != null) { + return false; + } + } + else if (!adress1.equals(other.adress1)) { + return false; + } + if (adress2 == null) { + if (other.adress2 != null) { + return false; + } + } + else if (!adress2.equals(other.adress2)) { + return false; + } + if (city == null) { + if (other.city != null) { + return false; + } + } + else if (!city.equals(other.city)) { + return false; + } + if (person == null) { + if (other.person != null) { + return false; + } + } + else if (!person.equals(other.person)) { + return false; + } + if (plz == null) { + if (other.plz != null) { + return false; + } + } + else if (!plz.equals(other.plz)) { + return false; + } + return true; + } + @Override public String toString() { return "Adress [adress1=" + adress1 + ", adress2=" + adress2 + ", plz=" + plz + ", city=" + city + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Altersgruppe.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Altersgruppe.java index cfb82ec..78df773 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Altersgruppe.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Altersgruppe.java @@ -12,15 +12,11 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - @Entity @Table(name = "altersgruppe") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Altersgruppe.findAll", query = "SELECT a FROM Altersgruppe a") -@EqualsAndHashCode(callSuper = true) -public @Data class Altersgruppe extends BaseEntity implements Serializable { +public class Altersgruppe extends BaseEntity implements Serializable { private static final long serialVersionUID = 126215772910869273L; @@ -48,4 +44,101 @@ public @Data class Altersgruppe extends BaseEntity implements Serializable { return year >= start && year <= end; } + public String getBezeichnung() { + return bezeichnung; + } + + public void setBezeichnung(String bezeichnung) { + this.bezeichnung = bezeichnung; + } + + public int getStart() { + return start; + } + + public void setStart(int start) { + this.start = start; + } + + public int getEnd() { + return end; + } + + public void setEnd(int end) { + this.end = end; + } + + public Pflicht getPflicht() { + return pflicht; + } + + public void setPflicht(Pflicht pflicht) { + this.pflicht = pflicht; + } + + public ClubEvent getClubEvent() { + return clubEvent; + } + + public void setClubEvent(ClubEvent clubEvent) { + this.clubEvent = clubEvent; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((bezeichnung == null) ? 0 : bezeichnung.hashCode()); + result = prime * result + ((clubEvent == null) ? 0 : clubEvent.hashCode()); + result = prime * result + end; + result = prime * result + ((pflicht == null) ? 0 : pflicht.hashCode()); + result = prime * result + start; + 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; + } + Altersgruppe other = (Altersgruppe) obj; + if (bezeichnung == null) { + if (other.bezeichnung != null) { + return false; + } + } + else if (!bezeichnung.equals(other.bezeichnung)) { + return false; + } + if (clubEvent == null) { + if (other.clubEvent != null) { + return false; + } + } + else if (!clubEvent.equals(other.clubEvent)) { + return false; + } + if (end != other.end) { + return false; + } + if (pflicht == null) { + if (other.pflicht != null) { + return false; + } + } + else if (!pflicht.equals(other.pflicht)) { + return false; + } + if (start != other.start) { + return false; + } + return true; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Attendance.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Attendance.java index bb1dc28..5f6c2d7 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Attendance.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Attendance.java @@ -13,9 +13,6 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the attendance database table. * @@ -24,8 +21,7 @@ import lombok.EqualsAndHashCode; @Table(name = "attendance") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Attendance.findAll", query = "SELECT a FROM Attendance a") -@EqualsAndHashCode(callSuper = true) -public @Data class Attendance extends BaseEntity implements Serializable { +public class Attendance extends BaseEntity implements Serializable { private static final long serialVersionUID = 2385033161272078335L; @@ -41,4 +37,61 @@ public @Data class Attendance extends BaseEntity implements Serializable { return new Date(this.onDate.getTime()); } + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public void setOnDate(Date onDate) { + this.onDate = onDate; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((onDate == null) ? 0 : onDate.hashCode()); + result = prime * result + ((person == null) ? 0 : person.hashCode()); + 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; + } + Attendance other = (Attendance) obj; + if (onDate == null) { + if (other.onDate != null) { + return false; + } + } + else if (!onDate.equals(other.onDate)) { + return false; + } + if (person == null) { + if (other.person != null) { + return false; + } + } + else if (!person.equals(other.person)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Attendance [person=" + person + ", onDate=" + onDate + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/BaseEntity.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/BaseEntity.java index 9920422..5da1aa2 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/BaseEntity.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/BaseEntity.java @@ -9,10 +9,8 @@ import javax.persistence.MappedSuperclass; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import lombok.Data; - @MappedSuperclass -public @Data abstract class BaseEntity implements EntityAccessor { +public abstract class BaseEntity implements EntityAccessor { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -62,9 +60,85 @@ public @Data abstract class BaseEntity implements EntityAccessor { this.deleted = new Date(deleted.getTime()); } + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + @Override public boolean hasValidId() { return id > 0; } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((changed == null) ? 0 : changed.hashCode()); + result = prime * result + ((created == null) ? 0 : created.hashCode()); + result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + BaseEntity other = (BaseEntity) obj; + if (changed == null) { + if (other.changed != null) { + return false; + } + } + else if (!changed.equals(other.changed)) { + return false; + } + if (created == null) { + if (other.created != null) { + return false; + } + } + else if (!created.equals(other.created)) { + return false; + } + if (deleted == null) { + if (other.deleted != null) { + return false; + } + } + else if (!deleted.equals(other.deleted)) { + return false; + } + if (id != other.id) { + return false; + } + return true; + } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("BaseEntity [id="); + stringBuilder.append(id); + stringBuilder.append(", changed="); + stringBuilder.append(changed); + if (deleted != null) { + stringBuilder.append(", deleted="); + stringBuilder.append(deleted); + } + stringBuilder.append("]"); + return stringBuilder.toString(); + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java index 2415462..9a53ba0 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java @@ -18,8 +18,6 @@ import javax.persistence.Transient; import org.vaadin.addon.calendar.item.BasicItem; import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.CompetitionType.Type; -import lombok.Data; -import lombok.EqualsAndHashCode; // Entity must not be used, this class is persisted by ClubEvent.hbm.xml @Entity @@ -28,8 +26,7 @@ import lombok.EqualsAndHashCode; * @author markus * */ -@EqualsAndHashCode(callSuper = true) -public @Data class ClubEvent extends BasicItem implements EntityAccessor { +public class ClubEvent extends BasicItem implements EntityAccessor { private static final long serialVersionUID = -3600971939167437577L; @@ -153,4 +150,118 @@ public @Data class ClubEvent extends BasicItem implements EntityAccessor { // noCreateDateStored } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getiCalUID() { + return iCalUID; + } + + public void setiCalUID(String iCalUID) { + this.iCalUID = iCalUID; + } + + public String getOrganizerDisplayName() { + return organizerDisplayName; + } + + public void setOrganizerDisplayName(String organizerDisplayName) { + this.organizerDisplayName = organizerDisplayName; + } + + public Set getPersons() { + return persons; + } + + public void setPersons(Set persons) { + this.persons = persons; + } + + public Set getAltersgruppen() { + return altersgruppen; + } + + public void setAltersgruppen(Set altersgruppen) { + this.altersgruppen = altersgruppen; + } + + public CompetitionType getCompetitionType() { + return competitionType; + } + + public void setCompetitionType(CompetitionType competitionType) { + this.competitionType = competitionType; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((competitionType == null) ? 0 : competitionType.hashCode()); + result = prime * result + ((iCalUID == null) ? 0 : iCalUID.hashCode()); + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((location == null) ? 0 : location.hashCode()); + 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; + } + ClubEvent other = (ClubEvent) obj; + if (competitionType == null) { + if (other.competitionType != null) { + return false; + } + } + else if (!competitionType.equals(other.competitionType)) { + return false; + } + if (iCalUID == null) { + if (other.iCalUID != null) { + return false; + } + } + else if (!iCalUID.equals(other.iCalUID)) { + return false; + } + if (id == null) { + if (other.id != null) { + return false; + } + } + else if (!id.equals(other.id)) { + return false; + } + if (location == null) { + if (other.location != null) { + return false; + } + } + else if (!location.equals(other.location)) { + return false; + } + return true; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java index 039f3ff..10ba5a6 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEventBuilder.java @@ -26,7 +26,7 @@ public class ClubEventBuilder { } public ClubEventBuilder withiCalUID(String iCalUID) { - current.setICalUID(iCalUID); + current.setiCalUID(iCalUID); return this; } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubeventPersonId.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubeventPersonId.java index b82a605..48043af 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubeventPersonId.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubeventPersonId.java @@ -5,10 +5,8 @@ import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Embeddable; -import lombok.Data; - @Embeddable -public @Data class ClubeventPersonId implements Serializable { +public class ClubeventPersonId implements Serializable { private static final long serialVersionUID = -7964369346971364916L; @@ -18,6 +16,57 @@ public @Data class ClubeventPersonId implements Serializable { @Column(name = "person_id") private int personId; + public String getClubEventId() { + return clubEventId; + } + + public void setClubEventId(String clubEventId) { + this.clubEventId = clubEventId; + } + + public int getPersonId() { + return personId; + } + + public void setPersonId(int personId) { + this.personId = personId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((clubEventId == null) ? 0 : clubEventId.hashCode()); + result = prime * result + personId; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ClubeventPersonId other = (ClubeventPersonId) obj; + if (clubEventId == null) { + if (other.clubEventId != null) { + return false; + } + } + else if (!clubEventId.equals(other.clubEventId)) { + return false; + } + if (personId != other.personId) { + return false; + } + return true; + } + @Override public String toString() { return "ID [clubEventId=" + clubEventId + ", personId=" + personId + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/CompetitionType.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/CompetitionType.java index 7c6a63c..f890520 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/CompetitionType.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/CompetitionType.java @@ -10,13 +10,9 @@ import javax.persistence.MapsId; import javax.persistence.OneToOne; import javax.persistence.Table; -import lombok.Data; - @Entity @Table(name = "clubevent_addon") -public @Data class CompetitionType implements Serializable { - - private static final long serialVersionUID = -6198405472773618194L; +public class CompetitionType implements Serializable { @Id private String id; @@ -41,6 +37,22 @@ public @Data class CompetitionType implements Serializable { this.clubEvent = clubEvent; } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ClubEvent getClubEvent() { + return clubEvent; + } + + public void setType(String type) { + this.type = type; + } + public static enum Type { EINZEL, SYNCHRON, @@ -49,6 +61,46 @@ public @Data class CompetitionType implements Serializable { LIGA } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + CompetitionType other = (CompetitionType) obj; + if (id == null) { + if (other.id != null) { + return false; + } + } + else if (!id.equals(other.id)) { + return false; + } + if (type == null) { + if (other.type != null) { + return false; + } + } + else if (!type.equals(other.type)) { + return false; + } + return true; + } + @Override public String toString() { return type; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Contact.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Contact.java index 22808f1..b9c9ef9 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Contact.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Contact.java @@ -9,9 +9,6 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the contact database table. * @@ -20,8 +17,7 @@ import lombok.EqualsAndHashCode; @Table(name = "contact") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Contact.findAll", query = "SELECT c FROM Contact c WHERE c.deleted is not null") -@EqualsAndHashCode(callSuper = true) -public @Data class Contact extends BaseEntity implements Serializable { +public class Contact extends BaseEntity implements Serializable { private static final long serialVersionUID = -7631864028095077913L; @@ -33,6 +29,79 @@ public @Data class Contact extends BaseEntity implements Serializable { @ManyToOne private Person person; + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((person == null) ? 0 : person.hashCode()); + result = prime * result + ((type == null) ? 0 : type.hashCode()); + result = prime * result + ((value == null) ? 0 : value.hashCode()); + 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; + } + Contact other = (Contact) obj; + if (person == null) { + if (other.person != null) { + return false; + } + } + else if (!person.equals(other.person)) { + return false; + } + if (type == null) { + if (other.type != null) { + return false; + } + } + else if (!type.equals(other.type)) { + return false; + } + if (value == null) { + if (other.value != null) { + return false; + } + } + else if (!value.equals(other.value)) { + return false; + } + return true; + } + @Override public String toString() { return "Contact [type=" + type + ", value=" + value + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/DeletedEntry.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/DeletedEntry.java index 6059e66..c14a1a7 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/DeletedEntry.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/DeletedEntry.java @@ -8,9 +8,6 @@ import javax.persistence.InheritanceType; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the deleted_entries database table. * @@ -19,8 +16,7 @@ import lombok.EqualsAndHashCode; @Table(name = "deleted_entries") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "DeletedEntry.findAll", query = "SELECT d FROM DeletedEntry d") -@EqualsAndHashCode(callSuper = true) -public @Data class DeletedEntry extends BaseEntity implements Serializable { +public class DeletedEntry extends BaseEntity implements Serializable { private static final long serialVersionUID = -4271189592258131845L; @@ -28,4 +24,60 @@ public @Data class DeletedEntry extends BaseEntity implements Serializable { private String tablename; + public int getEntryId() { + return entryId; + } + + public void setEntryId(int entryId) { + this.entryId = entryId; + } + + public String getTablename() { + return tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + entryId; + result = prime * result + ((tablename == null) ? 0 : tablename.hashCode()); + 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; + } + DeletedEntry other = (DeletedEntry) obj; + if (entryId != other.entryId) { + return false; + } + if (tablename == null) { + if (other.tablename != null) { + return false; + } + } + else if (!tablename.equals(other.tablename)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "DeletedEntry [entryId=" + entryId + ", tablename=" + tablename + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/GroupDef.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/GroupDef.java index 3e84eb3..eb92bed 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/GroupDef.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/GroupDef.java @@ -11,9 +11,6 @@ import javax.persistence.ManyToMany; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the groupDef database table. * @@ -22,13 +19,10 @@ import lombok.EqualsAndHashCode; @Table(name = "groupdef") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = GroupDef.QUERY_FINDALL, query = "SELECT g FROM GroupDef g") -@EqualsAndHashCode(callSuper = true) -public @Data class GroupDef extends BaseEntity implements Serializable { +public class GroupDef extends BaseEntity implements Serializable { public final static String QUERY_FINDALL = "GroupDef.findAll"; - private static final long serialVersionUID = -2827542956463449518L; - private String name; @ManyToMany(fetch = FetchType.LAZY, mappedBy = "groups") @@ -38,10 +32,66 @@ public @Data class GroupDef extends BaseEntity implements Serializable { persongroups.add(persongroup); } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getPersongroups() { + return persongroups; + } + + public void setPersongroups(List persongroups) { + this.persongroups = persongroups; + } + public void removePersongroup(Person persongroup) { getPersongroups().remove(persongroup); } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((persongroups == null) ? 0 : persongroups.hashCode()); + 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; + } + GroupDef other = (GroupDef) obj; + if (name == null) { + if (other.name != null) { + return false; + } + } + else if (!name.equals(other.name)) { + return false; + } + if (persongroups == null) { + if (other.persongroups != null) { + return false; + } + } + else if (!persongroups.equals(other.persongroups)) { + return false; + } + return true; + } + @Override public String toString() { return "GroupDef [id=" + getId() + ", name=" + name + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Person.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Person.java index cfe6eb5..b8f27f0 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Person.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Person.java @@ -20,9 +20,6 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the person database table. * @@ -33,8 +30,7 @@ import lombok.EqualsAndHashCode; @NamedQuery(name = Person.QUERY_FINDALL, query = "SELECT p FROM Person p WHERE p.deleted is null") @NamedQuery(name = Person.QUERY_FINDLOGIN, query = "FROM Person WHERE username = :username AND password = :password AND deleted is" + " null") -@EqualsAndHashCode(callSuper = true) -public @Data class Person extends BaseEntity implements Serializable { +public class Person extends BaseEntity implements Serializable { public static final String SESSION_LOGIN = "SESSION_LOGIN_USER"; @@ -131,6 +127,110 @@ public @Data class Person extends BaseEntity implements Serializable { events.remove(clubEvent); } + public LocalDate getBirth() { + return birth; + } + + public void setBirth(LocalDate birth) { + this.birth = birth; + } + + public String getPrename() { + return prename; + } + + public void setPrename(String prename) { + this.prename = prename; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getAdresses() { + return adresses; + } + + public void setAdresses(List adresses) { + this.adresses = adresses; + } + + public List getAttendances() { + return attendances; + } + + public void setAttendances(List attendances) { + this.attendances = attendances; + } + + public List getContacts() { + return contacts; + } + + public void setContacts(List contacts) { + this.contacts = contacts; + } + + public Set getGroups() { + return groups; + } + + public void setGroups(Set groups) { + this.groups = groups; + } + + public List getRelatives1() { + return relatives1; + } + + public void setRelatives1(List relatives1) { + this.relatives1 = relatives1; + } + + public List getRelatives2() { + return relatives2; + } + + public void setRelatives2(List relatives2) { + this.relatives2 = relatives2; + } + + public Set getEvents() { + return events; + } + + public void setEvents(Set events) { + this.events = events; + } + + public Startpass getStartpass() { + return startpass; + } + + public void setGender(Integer gender) { + this.gender = gender; + } + public Adress addAdress(Adress adress) { getAdresses().add(adress); adress.setPerson(this); @@ -238,6 +338,154 @@ public @Data class Person extends BaseEntity implements Serializable { this.startpass.setStartpassNr(startpass); } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((adresses == null) ? 0 : adresses.hashCode()); + result = prime * result + ((attendances == null) ? 0 : attendances.hashCode()); + result = prime * result + ((birth == null) ? 0 : birth.hashCode()); + result = prime * result + ((contacts == null) ? 0 : contacts.hashCode()); + result = prime * result + ((events == null) ? 0 : events.hashCode()); + result = prime * result + ((gender == null) ? 0 : gender.hashCode()); + result = prime * result + ((groups == null) ? 0 : groups.hashCode()); + result = prime * result + ((password == null) ? 0 : password.hashCode()); + result = prime * result + ((prename == null) ? 0 : prename.hashCode()); + result = prime * result + ((relatives1 == null) ? 0 : relatives1.hashCode()); + result = prime * result + ((relatives2 == null) ? 0 : relatives2.hashCode()); + result = prime * result + ((startpass == null) ? 0 : startpass.hashCode()); + result = prime * result + ((surname == null) ? 0 : surname.hashCode()); + result = prime * result + ((username == null) ? 0 : username.hashCode()); + 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; + } + Person other = (Person) obj; + if (adresses == null) { + if (other.adresses != null) { + return false; + } + } + else if (!adresses.equals(other.adresses)) { + return false; + } + if (attendances == null) { + if (other.attendances != null) { + return false; + } + } + else if (!attendances.equals(other.attendances)) { + return false; + } + if (birth == null) { + if (other.birth != null) { + return false; + } + } + else if (!birth.equals(other.birth)) { + return false; + } + if (contacts == null) { + if (other.contacts != null) { + return false; + } + } + else if (!contacts.equals(other.contacts)) { + return false; + } + if (events == null) { + if (other.events != null) { + return false; + } + } + else if (!events.equals(other.events)) { + return false; + } + if (gender == null) { + if (other.gender != null) { + return false; + } + } + else if (!gender.equals(other.gender)) { + return false; + } + if (groups == null) { + if (other.groups != null) { + return false; + } + } + else if (!groups.equals(other.groups)) { + return false; + } + if (password == null) { + if (other.password != null) { + return false; + } + } + else if (!password.equals(other.password)) { + return false; + } + if (prename == null) { + if (other.prename != null) { + return false; + } + } + else if (!prename.equals(other.prename)) { + return false; + } + if (relatives1 == null) { + if (other.relatives1 != null) { + return false; + } + } + else if (!relatives1.equals(other.relatives1)) { + return false; + } + if (relatives2 == null) { + if (other.relatives2 != null) { + return false; + } + } + else if (!relatives2.equals(other.relatives2)) { + return false; + } + if (startpass == null) { + if (other.startpass != null) { + return false; + } + } + else if (!startpass.equals(other.startpass)) { + return false; + } + if (surname == null) { + if (other.surname != null) { + return false; + } + } + else if (!surname.equals(other.surname)) { + return false; + } + if (username == null) { + if (other.username != null) { + return false; + } + } + else if (!username.equals(other.username)) { + return false; + } + return true; + } + @Override public String toString() { return "Person [id=" + getId() + ", prename=" + prename + ", surname=" + surname + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Persongroup.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Persongroup.java index a4890cf..4c37b7b 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Persongroup.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Persongroup.java @@ -10,9 +10,6 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the persongroup database table. * @@ -21,8 +18,7 @@ import lombok.EqualsAndHashCode; @Table(name = "persongroup") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Persongroup.findAll", query = "SELECT p FROM Persongroup p") -@EqualsAndHashCode(callSuper = true) -public @Data class Persongroup extends BaseEntity implements Serializable { +public class Persongroup extends BaseEntity implements Serializable { private static final long serialVersionUID = -2466223964213904302L; @@ -35,4 +31,65 @@ public @Data class Persongroup extends BaseEntity implements Serializable { @JoinColumn(name = "group_id") private GroupDef groupDef; + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public GroupDef getGroupDef() { + return groupDef; + } + + public void setGroupDef(GroupDef groupDef) { + this.groupDef = groupDef; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((groupDef == null) ? 0 : groupDef.hashCode()); + result = prime * result + ((person == null) ? 0 : person.hashCode()); + 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; + } + Persongroup other = (Persongroup) obj; + if (groupDef == null) { + if (other.groupDef != null) { + return false; + } + } + else if (!groupDef.equals(other.groupDef)) { + return false; + } + if (person == null) { + if (other.person != null) { + return false; + } + } + else if (!person.equals(other.person)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Persongroup [person=" + person + ", groupDef=" + groupDef + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Pflicht.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Pflicht.java index 0df26a4..a0575b2 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Pflicht.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Pflicht.java @@ -8,17 +8,11 @@ import javax.persistence.InheritanceType; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - @Entity @Table(name = "pflichten") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Pflicht.findAll", query = "SELECT p FROM Pflicht p") -@EqualsAndHashCode(callSuper = true) -public @Data class Pflicht extends BaseEntity implements Serializable, Comparable { - - private static final long serialVersionUID = -1309514158086518524L; +public class Pflicht extends BaseEntity implements Serializable, Comparable { private String name; @@ -38,6 +32,86 @@ public @Data class Pflicht extends BaseEntity implements Serializable, Comparabl this.comment = comment; } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isFixed() { + return fixed; + } + + public void setFixed(boolean fixed) { + this.fixed = fixed; + } + + public int getOrdered() { + return ordered; + } + + public void setOrdered(int ordered) { + this.ordered = ordered; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((comment == null) ? 0 : comment.hashCode()); + result = prime * result + (fixed ? 1231 : 1237); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ordered; + 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; + } + Pflicht other = (Pflicht) obj; + if (comment == null) { + if (other.comment != null) { + return false; + } + } + else if (!comment.equals(other.comment)) { + return false; + } + if (fixed != other.fixed) { + return false; + } + if (name == null) { + if (other.name != null) { + return false; + } + } + else if (!name.equals(other.name)) { + return false; + } + if (ordered != other.ordered) { + return false; + } + return true; + } + @Override public String toString() { return name; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relation.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relation.java index c7b2ad8..bf89dc9 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relation.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relation.java @@ -1,10 +1,5 @@ package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; -import lombok.Getter; -import lombok.ToString; - -@Getter -@ToString public class Relation { public enum RelationType { @@ -38,4 +33,61 @@ public class Relation { return RelationType.valueOf(relation); } + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public void setRelation(String relation) { + this.relation = relation; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((person == null) ? 0 : person.hashCode()); + result = prime * result + ((relation == null) ? 0 : relation.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Relation other = (Relation) obj; + if (person == null) { + if (other.person != null) { + return false; + } + } + else if (!person.equals(other.person)) { + return false; + } + if (relation == null) { + if (other.relation != null) { + return false; + } + } + else if (!relation.equals(other.relation)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Relation [person=" + person + ", relation=" + relation + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relative.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relative.java index 69ff015..6a72110 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relative.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Relative.java @@ -11,9 +11,6 @@ import javax.persistence.ManyToOne; import javax.persistence.NamedQuery; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the relative database table. * @@ -22,13 +19,10 @@ import lombok.EqualsAndHashCode; @Table(name = "relative") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = Relative.QUERY_FINDALL, query = "SELECT r FROM Relative r") -@EqualsAndHashCode(callSuper = false) -public @Data class Relative extends BaseEntity implements Serializable { +public class Relative extends BaseEntity implements Serializable { public static final String QUERY_FINDALL = "Relative.findAll"; - private static final long serialVersionUID = -1331008393583211773L; - @Column(name = "TO_PERSON1_RELATION") private String toPerson1Relation; @@ -45,6 +39,38 @@ public @Data class Relative extends BaseEntity implements Serializable { @JoinColumn(name = "person2") private Person person2Bean; + public String getToPerson1Relation() { + return toPerson1Relation; + } + + public void setToPerson1Relation(String toPerson1Relation) { + this.toPerson1Relation = toPerson1Relation; + } + + public String getToPerson2Relation() { + return toPerson2Relation; + } + + public void setToPerson2Relation(String toPerson2Relation) { + this.toPerson2Relation = toPerson2Relation; + } + + public Person getPerson1Bean() { + return person1Bean; + } + + public void setPerson1Bean(Person person1Bean) { + this.person1Bean = person1Bean; + } + + public Person getPerson2Bean() { + return person2Bean; + } + + public void setPerson2Bean(Person person2Bean) { + this.person2Bean = person2Bean; + } + public Relation getRelationTo(Person person) { if (person == null) { return null; @@ -60,4 +86,68 @@ public @Data class Relative extends BaseEntity implements Serializable { } } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((person1Bean == null) ? 0 : person1Bean.hashCode()); + result = prime * result + ((person2Bean == null) ? 0 : person2Bean.hashCode()); + result = prime * result + ((toPerson1Relation == null) ? 0 : toPerson1Relation.hashCode()); + result = prime * result + ((toPerson2Relation == null) ? 0 : toPerson2Relation.hashCode()); + 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; + } + Relative other = (Relative) obj; + if (person1Bean == null) { + if (other.person1Bean != null) { + return false; + } + } + else if (!person1Bean.equals(other.person1Bean)) { + return false; + } + if (person2Bean == null) { + if (other.person2Bean != null) { + return false; + } + } + else if (!person2Bean.equals(other.person2Bean)) { + return false; + } + if (toPerson1Relation == null) { + if (other.toPerson1Relation != null) { + return false; + } + } + else if (!toPerson1Relation.equals(other.toPerson1Relation)) { + return false; + } + if (toPerson2Relation == null) { + if (other.toPerson2Relation != null) { + return false; + } + } + else if (!toPerson2Relation.equals(other.toPerson2Relation)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "Relative [person1Bean=" + person1Bean + ", toPerson2Relation=" + toPerson2Relation + ", person2Bean=" + + person2Bean + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Startpass.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Startpass.java index bf191a6..4450c82 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Startpass.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Startpass.java @@ -14,9 +14,6 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.Table; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the startpaesse database table. * @@ -25,10 +22,7 @@ import lombok.EqualsAndHashCode; @Table(name = "startpaesse") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "Startpass.findAll", query = "SELECT s FROM Startpass s") -@EqualsAndHashCode(callSuper = true) -public @Data class Startpass extends BaseEntity implements Serializable { - - private static final long serialVersionUID = 1464510869007022357L; +public class Startpass extends BaseEntity implements Serializable { @Column(name = "startpass_nr") private String startpassNr; @@ -61,6 +55,70 @@ public @Data class Startpass extends BaseEntity implements Serializable { return startpassStartrechte; } + public String getStartpassNr() { + return startpassNr; + } + + public void setStartpassNr(String startpassNr) { + this.startpassNr = startpassNr; + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public List getStartpassStartrechte() { + return startpassStartrechte; + } + + public void setStartpassStartrechte(List startpassStartrechte) { + this.startpassStartrechte = startpassStartrechte; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((startpassNr == null) ? 0 : startpassNr.hashCode()); + result = prime * result + ((startpassStartrechte == null) ? 0 : startpassStartrechte.hashCode()); + 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; + } + Startpass other = (Startpass) obj; + if (startpassNr == null) { + if (other.startpassNr != null) { + return false; + } + } + else if (!startpassNr.equals(other.startpassNr)) { + return false; + } + if (startpassStartrechte == null) { + if (other.startpassStartrechte != null) { + return false; + } + } + else if (!startpassStartrechte.equals(other.startpassStartrechte)) { + return false; + } + return true; + } + @Override public String toString() { return "Startpass [startpassNr=" + startpassNr + "]"; diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/StartpassStartrechte.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/StartpassStartrechte.java index 7889e09..34f690f 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/StartpassStartrechte.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/StartpassStartrechte.java @@ -14,9 +14,6 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import lombok.Data; -import lombok.EqualsAndHashCode; - /** * The persistent class for the startpass_startrechte database table. * @@ -25,10 +22,7 @@ import lombok.EqualsAndHashCode; @Table(name = "startpass_startrechte") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @NamedQuery(name = "StartpassStartrechte.findAll", query = "SELECT s FROM StartpassStartrechte s") -@EqualsAndHashCode(callSuper = false) -public @Data class StartpassStartrechte extends BaseEntity implements Serializable { - - private static final long serialVersionUID = 292071407439270519L; +public class StartpassStartrechte extends BaseEntity implements Serializable { private String fachgebiet; @@ -60,4 +54,97 @@ public @Data class StartpassStartrechte extends BaseEntity implements Serializab this.startrechtEnde = startrechtEnde; } + public String getFachgebiet() { + return fachgebiet; + } + + public void setFachgebiet(String fachgebiet) { + this.fachgebiet = fachgebiet; + } + + public String getVereinName() { + return vereinName; + } + + public void setVereinName(String vereinName) { + this.vereinName = vereinName; + } + + public Startpass getStartpaesse() { + return startpaesse; + } + + public void setStartpaesse(Startpass startpaesse) { + this.startpaesse = startpaesse; + } + + public void setStartrechtBeginn(Date startrechtBeginn) { + this.startrechtBeginn = startrechtBeginn; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((fachgebiet == null) ? 0 : fachgebiet.hashCode()); + result = prime * result + ((startrechtBeginn == null) ? 0 : startrechtBeginn.hashCode()); + result = prime * result + ((startrechtEnde == null) ? 0 : startrechtEnde.hashCode()); + result = prime * result + ((vereinName == null) ? 0 : vereinName.hashCode()); + 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; + } + StartpassStartrechte other = (StartpassStartrechte) obj; + if (fachgebiet == null) { + if (other.fachgebiet != null) { + return false; + } + } + else if (!fachgebiet.equals(other.fachgebiet)) { + return false; + } + if (startrechtBeginn == null) { + if (other.startrechtBeginn != null) { + return false; + } + } + else if (!startrechtBeginn.equals(other.startrechtBeginn)) { + return false; + } + if (startrechtEnde == null) { + if (other.startrechtEnde != null) { + return false; + } + } + else if (!startrechtEnde.equals(other.startrechtEnde)) { + return false; + } + if (vereinName == null) { + if (other.vereinName != null) { + return false; + } + } + else if (!vereinName.equals(other.vereinName)) { + return false; + } + return true; + } + + @Override + public String toString() { + return "StartpassStartrechte [fachgebiet=" + fachgebiet + ", startrechtBeginn=" + startrechtBeginn + + ", startrechtEnde=" + startrechtEnde + ", vereinName=" + vereinName + ", startpaesse=" + startpaesse + + "]"; + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Version.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Version.java index d8d634b..ede35e6 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Version.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/Version.java @@ -12,8 +12,6 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import lombok.Data; - /** * The persistent class for the version database table. * @@ -21,9 +19,7 @@ import lombok.Data; @Entity @Table(name = "version") @NamedQuery(name = "Version.findAll", query = "SELECT v FROM Version v") -public @Data class Version implements Serializable { - - private static final long serialVersionUID = 1964331485558854626L; +public class Version implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -34,4 +30,82 @@ public @Data class Version implements Serializable { private int version; + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Date getDeleted() { + return deleted; + } + + public void setDeleted(Date deleted) { + this.deleted = deleted; + } + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); + result = prime * result + id; + result = prime * result + version; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + Version other = (Version) obj; + if (deleted == null) { + if (other.deleted != null) { + return false; + } + } + else if (!deleted.equals(other.deleted)) { + return false; + } + if (id != other.id) { + return false; + } + if (version != other.version) { + return false; + } + return true; + } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("Version [id="); + stringBuilder.append(id); + stringBuilder.append(", version="); + stringBuilder.append(version); + if (deleted != null) { + stringBuilder.append(", deleted="); + stringBuilder.append(deleted); + } + stringBuilder.append("]"); + return stringBuilder.toString(); + } + } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/navigation/HeadView.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/navigation/HeadView.java index 10d1fd8..48cdac8 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/navigation/HeadView.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/navigation/HeadView.java @@ -298,7 +298,7 @@ public class HeadView extends HorizontalLayout implements ApplicationContextAwar @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.context = applicationContext; + HeadView.context = applicationContext; } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f7fad49..895f0e4 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,9 @@ spring.datasource.jndi-name=jdbc/clubhelperbackend +# spring.datasource.url=jdbc:mysql://localhost:3306/clubhelper?useSSL=FALSE&useUnicode=yes&characterEncoding=utf8&serverTimezone=UTC +# spring.datasource.username=markus +# spring.datasource.password=07!73 + spring.jpa.open-in-view=false spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect