Competition addon: competition type.

master
Markus Kreth 7 years ago
parent 67ad26004c
commit b1725539ff
  1. 5
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java
  2. 34
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/CompetitionType.java
  3. 9
      src/main/resources/schema/version1.sql
  4. 21
      src/test/resources/truncateTables.sql

@ -9,7 +9,9 @@ import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.Transient;
import org.vaadin.addon.calendar.item.BasicItem;
@ -29,6 +31,9 @@ public class ClubEvent extends BasicItem implements EntityAccessor {
@ManyToMany
private Set<Person> persons;
private Set<Altersgruppe> altersgruppen;
@OneToOne
@JoinColumn(name = "id", nullable = true)
private CompetitionType competitionType;
ClubEvent() {
}

@ -0,0 +1,34 @@
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "clubevent_addon")
public class CompetitionType {
@Id
private String id;
private String type;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Type getType() {
return Type.valueOf(type);
}
public void setType(Type type) {
this.type = type.name();
}
public static enum Type {
EINZEL, SYNCHRON, DOPPELMINI, MANNSCHAFT, LIGA
}
}

@ -53,4 +53,13 @@ CREATE TABLE `event_has_altersgruppe` (
ON UPDATE NO ACTION);
ALTER TABLE `person`
ADD COLUMN `gender` SMALLINT(1) NULL AFTER `birth`;
CREATE TABLE `clubhelper`.`clubevent_addon` (
`id` VARCHAR(250) NOT NULL,
`competition_type` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_event_addon_id`
FOREIGN KEY (`id`)
REFERENCES `clubhelper`.`clubevent` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION);

@ -0,0 +1,21 @@
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE clubevent_addon;
TRUNCATE TABLE event_has_altersgruppe;
TRUNCATE TABLE altersgruppe;
TRUNCATE TABLE pflichten;
TRUNCATE TABLE clubevent_has_person;
TRUNCATE TABLE ClubEvent;
TRUNCATE TABLE persongroup;
TRUNCATE TABLE startpass_startrechte;
TRUNCATE TABLE deleted_entries;
TRUNCATE TABLE clubevent;
TRUNCATE TABLE relative;
TRUNCATE TABLE groupdef;
TRUNCATE TABLE startpaesse;
TRUNCATE TABLE contact;
TRUNCATE TABLE adress;
TRUNCATE TABLE attendance;
TRUNCATE TABLE person;
SET FOREIGN_KEY_CHECKS=1;
Loading…
Cancel
Save