parent
76c3754931
commit
3943e3a228
@ -1,195 +1,195 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
<modelVersion>4.0.0</modelVersion> |
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
<groupId>de.kreth.vaadin.clubhelper</groupId> |
<groupId>de.kreth.vaadin.clubhelper</groupId> |
||||||
<artifactId>vaadin-clubhelper</artifactId> |
<artifactId>vaadin-clubhelper</artifactId> |
||||||
<version>0.0.1-SNAPSHOT</version> |
<version>0.0.1-SNAPSHOT</version> |
||||||
<packaging>war</packaging> |
<packaging>war</packaging> |
||||||
|
|
||||||
<name>vaadin-clubhelper</name> |
<name>vaadin-clubhelper</name> |
||||||
<description>Demo project for Spring Boot</description> |
<description>Demo project for Spring Boot</description> |
||||||
|
|
||||||
<parent> |
<parent> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-starter-parent</artifactId> |
<artifactId>spring-boot-starter-parent</artifactId> |
||||||
<version>2.0.3.RELEASE</version> |
<version>2.0.3.RELEASE</version> |
||||||
<relativePath /> <!-- lookup parent from repository --> |
<relativePath /> <!-- lookup parent from repository --> |
||||||
</parent> |
</parent> |
||||||
|
|
||||||
<properties> |
<properties> |
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
||||||
<java.version>1.8</java.version> |
<java.version>1.8</java.version> |
||||||
<vaadin.version>8.4.4</vaadin.version> |
<vaadin.version>8.4.4</vaadin.version> |
||||||
<google-api-version>1.23.0</google-api-version> |
<google-api-version>1.23.0</google-api-version> |
||||||
<google-api-sheets-version>v4-rev488-1.23.0</google-api-sheets-version> |
<google-api-sheets-version>v4-rev488-1.23.0</google-api-sheets-version> |
||||||
<google-api-calendar-version>v3-rev271-1.23.0</google-api-calendar-version> |
<google-api-calendar-version>v3-rev271-1.23.0</google-api-calendar-version> |
||||||
</properties> |
</properties> |
||||||
|
|
||||||
<dependencies> |
<dependencies> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-starter-jdbc</artifactId> |
<artifactId>spring-boot-starter-jdbc</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<!-- <dependency> --> |
<!-- <dependency> --> |
||||||
<!-- <groupId>org.springframework.boot</groupId> --> |
<!-- <groupId>org.springframework.boot</groupId> --> |
||||||
<!-- <artifactId>spring-boot-starter-security</artifactId> --> |
<!-- <artifactId>spring-boot-starter-security</artifactId> --> |
||||||
<!-- </dependency> --> |
<!-- </dependency> --> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId> |
<artifactId>spring-boot-starter-data-jpa</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-starter-web</artifactId> |
<artifactId>spring-boot-starter-web</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.vaadin</groupId> |
<groupId>com.vaadin</groupId> |
||||||
<artifactId>vaadin-spring-boot-starter</artifactId> |
<artifactId>vaadin-spring-boot-starter</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.vaadin</groupId> |
<groupId>com.vaadin</groupId> |
||||||
<artifactId>vaadin-push</artifactId> |
<artifactId>vaadin-push</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.vaadin.teemu</groupId> |
<groupId>org.vaadin.teemu</groupId> |
||||||
<artifactId>switch</artifactId> |
<artifactId>switch</artifactId> |
||||||
<version>3.0.0</version> |
<version>3.0.0</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.hibernate</groupId> |
<groupId>org.vaadin.blackbluegl</groupId> |
||||||
<artifactId>hibernate-core</artifactId> |
<artifactId>calendar-component</artifactId> |
||||||
</dependency> |
<version>2.0-BETA4</version> |
||||||
<dependency> |
</dependency> |
||||||
<groupId>mysql</groupId> |
|
||||||
<artifactId>mysql-connector-java</artifactId> |
<dependency> |
||||||
</dependency> |
<groupId>org.hibernate</groupId> |
||||||
|
<artifactId>hibernate-core</artifactId> |
||||||
<dependency> |
</dependency> |
||||||
<groupId>org.vaadin.blackbluegl</groupId> |
<dependency> |
||||||
<artifactId>calendar-component</artifactId> |
<groupId>mysql</groupId> |
||||||
<version>2.0-BETA4</version> |
<artifactId>mysql-connector-java</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
|
|
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.google.apis</groupId> |
<groupId>com.google.apis</groupId> |
||||||
<artifactId>google-api-services-calendar</artifactId> |
<artifactId>google-api-services-calendar</artifactId> |
||||||
<version>${google-api-calendar-version}</version> |
<version>${google-api-calendar-version}</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.google.api-client</groupId> |
<groupId>com.google.api-client</groupId> |
||||||
<artifactId>google-api-client-appengine</artifactId> |
<artifactId>google-api-client-appengine</artifactId> |
||||||
<version>${google-api-version}</version> |
<version>${google-api-version}</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.google.api-client</groupId> |
<groupId>com.google.api-client</groupId> |
||||||
<artifactId>google-api-client-gson</artifactId> |
<artifactId>google-api-client-gson</artifactId> |
||||||
<version>${google-api-version}</version> |
<version>${google-api-version}</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.google.oauth-client</groupId> |
<groupId>com.google.oauth-client</groupId> |
||||||
<artifactId>google-oauth-client-java6</artifactId> |
<artifactId>google-oauth-client-java6</artifactId> |
||||||
<version>${google-api-version}</version> |
<version>${google-api-version}</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.google.oauth-client</groupId> |
<groupId>com.google.oauth-client</groupId> |
||||||
<artifactId>google-oauth-client-jetty</artifactId> |
<artifactId>google-oauth-client-jetty</artifactId> |
||||||
<version>${google-api-version}</version> |
<version>${google-api-version}</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.slf4j</groupId> |
<groupId>org.slf4j</groupId> |
||||||
<artifactId>slf4j-api</artifactId> |
<artifactId>slf4j-api</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>ch.qos.logback</groupId> |
<groupId>ch.qos.logback</groupId> |
||||||
<artifactId>logback-classic</artifactId> |
<artifactId>logback-classic</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
|
|
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-starter-test</artifactId> |
<artifactId>spring-boot-starter-test</artifactId> |
||||||
<scope>test</scope> |
<scope>test</scope> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.springframework.security</groupId> |
<groupId>org.springframework.security</groupId> |
||||||
<artifactId>spring-security-test</artifactId> |
<artifactId>spring-security-test</artifactId> |
||||||
<scope>test</scope> |
<scope>test</scope> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.h2database</groupId> |
<groupId>com.h2database</groupId> |
||||||
<artifactId>h2</artifactId> |
<artifactId>h2</artifactId> |
||||||
<scope>test</scope> |
<scope>test</scope> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>commons-io</groupId> |
<groupId>commons-io</groupId> |
||||||
<artifactId>commons-io</artifactId> |
<artifactId>commons-io</artifactId> |
||||||
<version>2.6</version> |
<version>2.6</version> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.hibernate</groupId> |
<groupId>org.hibernate</groupId> |
||||||
<artifactId>hibernate-testing</artifactId> |
<artifactId>hibernate-testing</artifactId> |
||||||
<scope>test</scope> |
<scope>test</scope> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.hibernate</groupId> |
<groupId>org.hibernate</groupId> |
||||||
<artifactId>hibernate-entitymanager</artifactId> |
<artifactId>hibernate-entitymanager</artifactId> |
||||||
<scope>test</scope> |
<scope>test</scope> |
||||||
</dependency> |
</dependency> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>org.slf4j</groupId> |
<groupId>org.slf4j</groupId> |
||||||
<artifactId>slf4j-simple</artifactId> |
<artifactId>slf4j-simple</artifactId> |
||||||
</dependency> |
</dependency> |
||||||
</dependencies> |
</dependencies> |
||||||
|
|
||||||
<dependencyManagement> |
<dependencyManagement> |
||||||
<dependencies> |
<dependencies> |
||||||
<dependency> |
<dependency> |
||||||
<groupId>com.vaadin</groupId> |
<groupId>com.vaadin</groupId> |
||||||
<artifactId>vaadin-bom</artifactId> |
<artifactId>vaadin-bom</artifactId> |
||||||
<version>${vaadin.version}</version> |
<version>${vaadin.version}</version> |
||||||
<type>pom</type> |
<type>pom</type> |
||||||
<scope>import</scope> |
<scope>import</scope> |
||||||
</dependency> |
</dependency> |
||||||
</dependencies> |
</dependencies> |
||||||
</dependencyManagement> |
</dependencyManagement> |
||||||
|
|
||||||
<build> |
<build> |
||||||
<plugins> |
<plugins> |
||||||
<plugin> |
<plugin> |
||||||
<groupId>org.springframework.boot</groupId> |
<groupId>org.springframework.boot</groupId> |
||||||
<artifactId>spring-boot-maven-plugin</artifactId> |
<artifactId>spring-boot-maven-plugin</artifactId> |
||||||
</plugin> |
</plugin> |
||||||
|
|
||||||
<plugin> |
<plugin> |
||||||
<groupId>com.vaadin</groupId> |
<groupId>com.vaadin</groupId> |
||||||
<artifactId>vaadin-maven-plugin</artifactId> |
<artifactId>vaadin-maven-plugin</artifactId> |
||||||
<version>${vaadin.version}</version> |
<version>${vaadin.version}</version> |
||||||
<executions> |
<executions> |
||||||
<execution> |
<execution> |
||||||
<goals> |
<goals> |
||||||
<goal>update-theme</goal> |
<goal>update-theme</goal> |
||||||
<goal>update-widgetset</goal> |
<goal>update-widgetset</goal> |
||||||
<goal>compile</goal> |
<goal>compile</goal> |
||||||
<!-- Comment out compile-theme goal to use on-the-fly theme compilation --> |
<!-- Comment out compile-theme goal to use on-the-fly theme compilation --> |
||||||
<goal>compile-theme</goal> |
<goal>compile-theme</goal> |
||||||
</goals> |
</goals> |
||||||
</execution> |
</execution> |
||||||
</executions> |
</executions> |
||||||
<configuration> |
<configuration> |
||||||
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath> |
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath> |
||||||
</configuration> |
</configuration> |
||||||
</plugin> |
</plugin> |
||||||
</plugins> |
</plugins> |
||||||
</build> |
</build> |
||||||
|
|
||||||
<repositories> |
<repositories> |
||||||
<repository> |
<repository> |
||||||
<id>vaadin-addons</id> |
<id>vaadin-addons</id> |
||||||
<url>http://maven.vaadin.com/vaadin-addons</url> |
<url>http://maven.vaadin.com/vaadin-addons</url> |
||||||
</repository> |
</repository> |
||||||
</repositories> |
</repositories> |
||||||
|
|
||||||
</project> |
</project> |
||||||
|
|||||||
@ -1,25 +1,25 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> |
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> |
||||||
<persistence-unit name="vaadin-clubhelper" transaction-type="RESOURCE_LOCAL"> |
<persistence-unit name="vaadin-clubhelper" transaction-type="RESOURCE_LOCAL"> |
||||||
<provider>org.hibernate.ejb.HibernatePersistence</provider> |
<provider>org.hibernate.ejb.HibernatePersistence</provider> |
||||||
<mapping-file>schema/ClubEvent.hbm.xml</mapping-file> |
<mapping-file>schema/ClubEvent.hbm.xml</mapping-file> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Adress</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Adress</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Attendance</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Attendance</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Contact</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Contact</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.DeletedEntry</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.DeletedEntry</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Persongroup</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Persongroup</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Relative</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Relative</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Startpaesse</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Startpaesse</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.StartpassStartrechte</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.StartpassStartrechte</class> |
||||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Version</class> |
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Version</class> |
||||||
<properties> |
<properties> |
||||||
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/> |
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/> |
||||||
<property name="javax.persistence.jdbc.url" value="localhost:3306"/> |
<property name="javax.persistence.jdbc.url" value="localhost:3306"/> |
||||||
<property name="javax.persistence.jdbc.user" value="root"/> |
<property name="javax.persistence.jdbc.user" value="root"/> |
||||||
<property name="javax.persistence.jdbc.password" value="07!73"/> |
<property name="javax.persistence.jdbc.password" value="07!73"/> |
||||||
<property name="javax.persistence.schema-generation.scripts.action" value="create"/> |
<property name="javax.persistence.schema-generation.scripts.action" value="create"/> |
||||||
</properties> |
</properties> |
||||||
</persistence-unit> |
</persistence-unit> |
||||||
</persistence> |
</persistence> |
||||||
|
|||||||
@ -1,152 +1,152 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||||
|
|
||||||
import java.io.Serializable; |
import java.io.Serializable; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
import javax.persistence.Entity; |
import javax.persistence.Entity; |
||||||
import javax.persistence.FetchType; |
import javax.persistence.FetchType; |
||||||
import javax.persistence.GeneratedValue; |
import javax.persistence.GeneratedValue; |
||||||
import javax.persistence.GenerationType; |
import javax.persistence.GenerationType; |
||||||
import javax.persistence.Id; |
import javax.persistence.Id; |
||||||
import javax.persistence.JoinColumn; |
import javax.persistence.JoinColumn; |
||||||
import javax.persistence.JoinTable; |
import javax.persistence.JoinTable; |
||||||
import javax.persistence.ManyToMany; |
import javax.persistence.ManyToMany; |
||||||
import javax.persistence.NamedQuery; |
import javax.persistence.NamedQuery; |
||||||
import javax.persistence.Table; |
import javax.persistence.Table; |
||||||
import javax.persistence.Temporal; |
import javax.persistence.Temporal; |
||||||
import javax.persistence.TemporalType; |
import javax.persistence.TemporalType; |
||||||
|
|
||||||
/** |
/** |
||||||
* The persistent class for the groupDef database table. |
* The persistent class for the groupDef database table. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
@Entity(name = "groupDef") |
@Entity(name = "groupDef") |
||||||
@Table(name = "groupDef") |
@Table(name = "groupDef") |
||||||
@NamedQuery(name = GroupDef.QUERY_FINDALL, query = "SELECT g FROM groupDef g") |
@NamedQuery(name = GroupDef.QUERY_FINDALL, query = "SELECT g FROM groupDef g") |
||||||
public class GroupDef implements Serializable { |
public class GroupDef implements Serializable { |
||||||
|
|
||||||
public final static String QUERY_FINDALL = "GroupDef.findAll"; |
public final static String QUERY_FINDALL = "GroupDef.findAll"; |
||||||
|
|
||||||
private static final long serialVersionUID = -2827542956463449518L; |
private static final long serialVersionUID = -2827542956463449518L; |
||||||
|
|
||||||
@Id |
@Id |
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||||
private int id; |
private int id; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date changed; |
private Date changed; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date created; |
private Date created; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date deleted; |
private Date deleted; |
||||||
|
|
||||||
private String name; |
private String name; |
||||||
|
|
||||||
@ManyToMany(fetch=FetchType.LAZY) |
@ManyToMany(fetch=FetchType.LAZY) |
||||||
@JoinTable (name = "persongroup", |
@JoinTable (name = "persongroup", |
||||||
joinColumns = { @JoinColumn(name = "group_id") }, |
joinColumns = { @JoinColumn(name = "group_id") }, |
||||||
inverseJoinColumns = { @JoinColumn(name = "person_id") }) |
inverseJoinColumns = { @JoinColumn(name = "person_id") }) |
||||||
private List<Persongroup> persongroups; |
private List<Persongroup> persongroups; |
||||||
|
|
||||||
public GroupDef() { |
public GroupDef() { |
||||||
} |
} |
||||||
|
|
||||||
public int getId() { |
public int getId() { |
||||||
return this.id; |
return this.id; |
||||||
} |
} |
||||||
|
|
||||||
public void setId(int id) { |
public void setId(int id) { |
||||||
this.id = id; |
this.id = id; |
||||||
} |
} |
||||||
|
|
||||||
public Date getChanged() { |
public Date getChanged() { |
||||||
return this.changed; |
return this.changed; |
||||||
} |
} |
||||||
|
|
||||||
public void setChanged(Date changed) { |
public void setChanged(Date changed) { |
||||||
this.changed = changed; |
this.changed = changed; |
||||||
} |
} |
||||||
|
|
||||||
public Date getCreated() { |
public Date getCreated() { |
||||||
return this.created; |
return this.created; |
||||||
} |
} |
||||||
|
|
||||||
public void setCreated(Date created) { |
public void setCreated(Date created) { |
||||||
this.created = created; |
this.created = created; |
||||||
} |
} |
||||||
|
|
||||||
public Date getDeleted() { |
public Date getDeleted() { |
||||||
return this.deleted; |
return this.deleted; |
||||||
} |
} |
||||||
|
|
||||||
public void setDeleted(Date deleted) { |
public void setDeleted(Date deleted) { |
||||||
this.deleted = deleted; |
this.deleted = deleted; |
||||||
} |
} |
||||||
|
|
||||||
public String getName() { |
public String getName() { |
||||||
return this.name; |
return this.name; |
||||||
} |
} |
||||||
|
|
||||||
public void setName(String name) { |
public void setName(String name) { |
||||||
this.name = name; |
this.name = name; |
||||||
} |
} |
||||||
|
|
||||||
public List<Persongroup> getPersongroups() { |
public List<Persongroup> getPersongroups() { |
||||||
return this.persongroups; |
return this.persongroups; |
||||||
} |
} |
||||||
|
|
||||||
public void setPersongroups(List<Persongroup> persongroups) { |
public void setPersongroups(List<Persongroup> persongroups) { |
||||||
this.persongroups = persongroups; |
this.persongroups = persongroups; |
||||||
} |
} |
||||||
|
|
||||||
public Persongroup addPersongroup(Persongroup persongroup) { |
public Persongroup addPersongroup(Persongroup persongroup) { |
||||||
getPersongroups().add(persongroup); |
getPersongroups().add(persongroup); |
||||||
persongroup.setGroupDef(this); |
persongroup.setGroupDef(this); |
||||||
|
|
||||||
return persongroup; |
return persongroup; |
||||||
} |
} |
||||||
|
|
||||||
public Persongroup removePersongroup(Persongroup persongroup) { |
public Persongroup removePersongroup(Persongroup persongroup) { |
||||||
getPersongroups().remove(persongroup); |
getPersongroups().remove(persongroup); |
||||||
persongroup.setGroupDef(null); |
persongroup.setGroupDef(null); |
||||||
|
|
||||||
return persongroup; |
return persongroup; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public String toString() { |
public String toString() { |
||||||
return "GroupDef [id=" + id + ", name=" + name + "]"; |
return "GroupDef [id=" + id + ", name=" + name + "]"; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int hashCode() { |
public int hashCode() { |
||||||
final int prime = 31; |
final int prime = 31; |
||||||
int result = 1; |
int result = 1; |
||||||
result = prime * result + id; |
result = prime * result + id; |
||||||
result = prime * result + ((name == null) ? 0 : name.hashCode()); |
result = prime * result + ((name == null) ? 0 : name.hashCode()); |
||||||
return result; |
return result; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public boolean equals(Object obj) { |
public boolean equals(Object obj) { |
||||||
if (this == obj) |
if (this == obj) |
||||||
return true; |
return true; |
||||||
if (obj == null) |
if (obj == null) |
||||||
return false; |
return false; |
||||||
if (getClass() != obj.getClass()) |
if (getClass() != obj.getClass()) |
||||||
return false; |
return false; |
||||||
GroupDef other = (GroupDef) obj; |
GroupDef other = (GroupDef) obj; |
||||||
if (id != other.id) |
if (id != other.id) |
||||||
return false; |
return false; |
||||||
if (name == null) { |
if (name == null) { |
||||||
if (other.name != null) |
if (other.name != null) |
||||||
return false; |
return false; |
||||||
} else if (!name.equals(other.name)) |
} else if (!name.equals(other.name)) |
||||||
return false; |
return false; |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
@ -1,365 +1,365 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||||
|
|
||||||
import java.io.Serializable; |
import java.io.Serializable; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
|
|
||||||
import javax.persistence.*; |
import javax.persistence.*; |
||||||
|
|
||||||
/** |
/** |
||||||
* The persistent class for the person database table. |
* The persistent class for the person database table. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
@Entity |
@Entity |
||||||
@Table(name = "person") |
@Table(name = "person") |
||||||
@NamedQuery(name = Person.QUERY_FINDALL, query = "SELECT p FROM Person p") |
@NamedQuery(name = Person.QUERY_FINDALL, query = "SELECT p FROM Person p") |
||||||
public class Person implements Serializable { |
public class Person implements Serializable { |
||||||
|
|
||||||
public final static String QUERY_FINDALL = "Person.findAll"; |
public final static String QUERY_FINDALL = "Person.findAll"; |
||||||
|
|
||||||
private static final long serialVersionUID = -8361264400619997123L; |
private static final long serialVersionUID = -8361264400619997123L; |
||||||
|
|
||||||
@Id |
@Id |
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||||
private int id; |
private int id; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date birth; |
private Date birth; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date changed; |
private Date changed; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date created; |
private Date created; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date deleted; |
private Date deleted; |
||||||
|
|
||||||
private String password; |
private String password; |
||||||
|
|
||||||
private String prename; |
private String prename; |
||||||
|
|
||||||
private String surname; |
private String surname; |
||||||
|
|
||||||
private String username; |
private String username; |
||||||
|
|
||||||
// bi-directional many-to-one association to Adress
|
// bi-directional many-to-one association to Adress
|
||||||
@OneToMany(mappedBy = "person") |
@OneToMany(mappedBy = "person") |
||||||
private List<Adress> adresses; |
private List<Adress> adresses; |
||||||
|
|
||||||
// bi-directional many-to-one association to Attendance
|
// bi-directional many-to-one association to Attendance
|
||||||
@OneToMany(mappedBy = "person") |
@OneToMany(mappedBy = "person") |
||||||
private List<Attendance> attendances; |
private List<Attendance> attendances; |
||||||
|
|
||||||
// bi-directional many-to-one association to Contact
|
// bi-directional many-to-one association to Contact
|
||||||
@OneToMany(mappedBy = "person") |
@OneToMany(mappedBy = "person") |
||||||
private List<Contact> contacts; |
private List<Contact> contacts; |
||||||
|
|
||||||
// bi-directional many-to-many association to Persongroup
|
// bi-directional many-to-many association to Persongroup
|
||||||
@ManyToMany(fetch=FetchType.EAGER) |
@ManyToMany(fetch=FetchType.EAGER) |
||||||
@JoinTable (name = "persongroup", |
@JoinTable (name = "persongroup", |
||||||
joinColumns = { @JoinColumn(name = "person_id") }, |
joinColumns = { @JoinColumn(name = "person_id") }, |
||||||
inverseJoinColumns = { @JoinColumn(name = "group_id") }) |
inverseJoinColumns = { @JoinColumn(name = "group_id") }) |
||||||
private List<GroupDef> groups; |
private List<GroupDef> groups; |
||||||
|
|
||||||
// bi-directional many-to-one association to Relative
|
// bi-directional many-to-one association to Relative
|
||||||
@OneToMany(mappedBy = "person1Bean") |
@OneToMany(mappedBy = "person1Bean") |
||||||
private List<Relative> relatives1; |
private List<Relative> relatives1; |
||||||
|
|
||||||
// bi-directional many-to-one association to Relative
|
// bi-directional many-to-one association to Relative
|
||||||
@OneToMany(mappedBy = "person2Bean") |
@OneToMany(mappedBy = "person2Bean") |
||||||
private List<Relative> relatives2; |
private List<Relative> relatives2; |
||||||
|
|
||||||
// bi-directional many-to-one association to Startpaesse
|
// bi-directional many-to-one association to Startpaesse
|
||||||
@OneToMany(mappedBy = "person") |
@OneToMany(mappedBy = "person") |
||||||
private List<Startpaesse> startpaesses; |
private List<Startpaesse> startpaesses; |
||||||
|
|
||||||
@ManyToMany(cascade = { CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE, CascadeType.DETACH }, fetch = FetchType.LAZY) |
@ManyToMany(cascade = { CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE, CascadeType.DETACH }, fetch = FetchType.LAZY) |
||||||
@JoinTable( |
@JoinTable( |
||||||
name = "clubevent_has_person", |
name = "clubevent_has_person", |
||||||
joinColumns = { @JoinColumn(name = "person_id") }, |
joinColumns = { @JoinColumn(name = "person_id") }, |
||||||
inverseJoinColumns = { @JoinColumn(name = "clubevent_id") } |
inverseJoinColumns = { @JoinColumn(name = "clubevent_id") } |
||||||
) |
) |
||||||
private Set<ClubEvent> events; |
private Set<ClubEvent> events; |
||||||
|
|
||||||
public Person() { |
public Person() { |
||||||
} |
} |
||||||
|
|
||||||
public int getId() { |
public int getId() { |
||||||
return this.id; |
return this.id; |
||||||
} |
} |
||||||
|
|
||||||
public void setId(int id) { |
public void setId(int id) { |
||||||
this.id = id; |
this.id = id; |
||||||
} |
} |
||||||
|
|
||||||
public Date getBirth() { |
public Date getBirth() { |
||||||
return this.birth; |
return this.birth; |
||||||
} |
} |
||||||
|
|
||||||
public void setBirth(Date birth) { |
public void setBirth(Date birth) { |
||||||
this.birth = birth; |
this.birth = birth; |
||||||
} |
} |
||||||
|
|
||||||
public Date getChanged() { |
public Date getChanged() { |
||||||
return this.changed; |
return this.changed; |
||||||
} |
} |
||||||
|
|
||||||
public void setChanged(Date changed) { |
public void setChanged(Date changed) { |
||||||
this.changed = changed; |
this.changed = changed; |
||||||
} |
} |
||||||
|
|
||||||
public Date getCreated() { |
public Date getCreated() { |
||||||
return this.created; |
return this.created; |
||||||
} |
} |
||||||
|
|
||||||
public void setCreated(Date created) { |
public void setCreated(Date created) { |
||||||
this.created = created; |
this.created = created; |
||||||
} |
} |
||||||
|
|
||||||
public Date getDeleted() { |
public Date getDeleted() { |
||||||
return this.deleted; |
return this.deleted; |
||||||
} |
} |
||||||
|
|
||||||
public void setDeleted(Date deleted) { |
public void setDeleted(Date deleted) { |
||||||
this.deleted = deleted; |
this.deleted = deleted; |
||||||
} |
} |
||||||
|
|
||||||
public String getPassword() { |
public String getPassword() { |
||||||
return this.password; |
return this.password; |
||||||
} |
} |
||||||
|
|
||||||
public void setPassword(String password) { |
public void setPassword(String password) { |
||||||
this.password = password; |
this.password = password; |
||||||
} |
} |
||||||
|
|
||||||
public String getPrename() { |
public String getPrename() { |
||||||
return this.prename; |
return this.prename; |
||||||
} |
} |
||||||
|
|
||||||
public void setPrename(String prename) { |
public void setPrename(String prename) { |
||||||
this.prename = prename; |
this.prename = prename; |
||||||
} |
} |
||||||
|
|
||||||
public String getSurname() { |
public String getSurname() { |
||||||
return this.surname; |
return this.surname; |
||||||
} |
} |
||||||
|
|
||||||
public void setSurname(String surname) { |
public void setSurname(String surname) { |
||||||
this.surname = surname; |
this.surname = surname; |
||||||
} |
} |
||||||
|
|
||||||
public String getUsername() { |
public String getUsername() { |
||||||
return this.username; |
return this.username; |
||||||
} |
} |
||||||
|
|
||||||
public void setUsername(String username) { |
public void setUsername(String username) { |
||||||
this.username = username; |
this.username = username; |
||||||
} |
} |
||||||
|
|
||||||
public List<Adress> getAdresses() { |
public List<Adress> getAdresses() { |
||||||
return this.adresses; |
return this.adresses; |
||||||
} |
} |
||||||
|
|
||||||
public void setAdresses(List<Adress> adresses) { |
public void setAdresses(List<Adress> adresses) { |
||||||
this.adresses = adresses; |
this.adresses = adresses; |
||||||
} |
} |
||||||
|
|
||||||
public Adress addAdress(Adress adress) { |
public Adress addAdress(Adress adress) { |
||||||
getAdresses().add(adress); |
getAdresses().add(adress); |
||||||
adress.setPerson(this); |
adress.setPerson(this); |
||||||
|
|
||||||
return adress; |
return adress; |
||||||
} |
} |
||||||
|
|
||||||
public Adress removeAdress(Adress adress) { |
public Adress removeAdress(Adress adress) { |
||||||
getAdresses().remove(adress); |
getAdresses().remove(adress); |
||||||
adress.setPerson(null); |
adress.setPerson(null); |
||||||
|
|
||||||
return adress; |
return adress; |
||||||
} |
} |
||||||
|
|
||||||
public List<Attendance> getAttendances() { |
public List<Attendance> getAttendances() { |
||||||
return this.attendances; |
return this.attendances; |
||||||
} |
} |
||||||
|
|
||||||
public void setAttendances(List<Attendance> attendances) { |
public void setAttendances(List<Attendance> attendances) { |
||||||
this.attendances = attendances; |
this.attendances = attendances; |
||||||
} |
} |
||||||
|
|
||||||
public Attendance addAttendance(Attendance attendance) { |
public Attendance addAttendance(Attendance attendance) { |
||||||
getAttendances().add(attendance); |
getAttendances().add(attendance); |
||||||
attendance.setPerson(this); |
attendance.setPerson(this); |
||||||
|
|
||||||
return attendance; |
return attendance; |
||||||
} |
} |
||||||
|
|
||||||
public Attendance removeAttendance(Attendance attendance) { |
public Attendance removeAttendance(Attendance attendance) { |
||||||
getAttendances().remove(attendance); |
getAttendances().remove(attendance); |
||||||
attendance.setPerson(null); |
attendance.setPerson(null); |
||||||
|
|
||||||
return attendance; |
return attendance; |
||||||
} |
} |
||||||
|
|
||||||
public List<Contact> getContacts() { |
public List<Contact> getContacts() { |
||||||
return this.contacts; |
return this.contacts; |
||||||
} |
} |
||||||
|
|
||||||
public void setContacts(List<Contact> contacts) { |
public void setContacts(List<Contact> contacts) { |
||||||
this.contacts = contacts; |
this.contacts = contacts; |
||||||
} |
} |
||||||
|
|
||||||
public Contact addContact(Contact contact) { |
public Contact addContact(Contact contact) { |
||||||
getContacts().add(contact); |
getContacts().add(contact); |
||||||
contact.setPerson(this); |
contact.setPerson(this); |
||||||
|
|
||||||
return contact; |
return contact; |
||||||
} |
} |
||||||
|
|
||||||
public Contact removeContact(Contact contact) { |
public Contact removeContact(Contact contact) { |
||||||
getContacts().remove(contact); |
getContacts().remove(contact); |
||||||
contact.setPerson(null); |
contact.setPerson(null); |
||||||
|
|
||||||
return contact; |
return contact; |
||||||
} |
} |
||||||
|
|
||||||
public List<GroupDef> getPersongroups() { |
public List<GroupDef> getPersongroups() { |
||||||
return this.groups; |
return this.groups; |
||||||
} |
} |
||||||
|
|
||||||
public void setPersongroups(List<GroupDef> persongroups) { |
public void setPersongroups(List<GroupDef> persongroups) { |
||||||
this.groups = persongroups; |
this.groups = persongroups; |
||||||
} |
} |
||||||
|
|
||||||
public void addPersongroup(GroupDef persongroup) { |
public void addPersongroup(GroupDef persongroup) { |
||||||
getPersongroups().add(persongroup); |
getPersongroups().add(persongroup); |
||||||
} |
} |
||||||
|
|
||||||
public void removePersongroup(GroupDef persongroup) { |
public void removePersongroup(GroupDef persongroup) { |
||||||
getPersongroups().remove(persongroup); |
getPersongroups().remove(persongroup); |
||||||
} |
} |
||||||
|
|
||||||
public List<Relative> getRelatives1() { |
public List<Relative> getRelatives1() { |
||||||
return this.relatives1; |
return this.relatives1; |
||||||
} |
} |
||||||
|
|
||||||
public void setRelatives1(List<Relative> relatives1) { |
public void setRelatives1(List<Relative> relatives1) { |
||||||
this.relatives1 = relatives1; |
this.relatives1 = relatives1; |
||||||
} |
} |
||||||
|
|
||||||
public Relative addRelatives1(Relative relatives1) { |
public Relative addRelatives1(Relative relatives1) { |
||||||
getRelatives1().add(relatives1); |
getRelatives1().add(relatives1); |
||||||
relatives1.setPerson1Bean(this); |
relatives1.setPerson1Bean(this); |
||||||
|
|
||||||
return relatives1; |
return relatives1; |
||||||
} |
} |
||||||
|
|
||||||
public Relative removeRelatives1(Relative relatives1) { |
public Relative removeRelatives1(Relative relatives1) { |
||||||
getRelatives1().remove(relatives1); |
getRelatives1().remove(relatives1); |
||||||
relatives1.setPerson1Bean(null); |
relatives1.setPerson1Bean(null); |
||||||
|
|
||||||
return relatives1; |
return relatives1; |
||||||
} |
} |
||||||
|
|
||||||
public List<Relative> getRelatives2() { |
public List<Relative> getRelatives2() { |
||||||
return this.relatives2; |
return this.relatives2; |
||||||
} |
} |
||||||
|
|
||||||
public void setRelatives2(List<Relative> relatives2) { |
public void setRelatives2(List<Relative> relatives2) { |
||||||
this.relatives2 = relatives2; |
this.relatives2 = relatives2; |
||||||
} |
} |
||||||
|
|
||||||
public Relative addRelatives2(Relative relatives2) { |
public Relative addRelatives2(Relative relatives2) { |
||||||
getRelatives2().add(relatives2); |
getRelatives2().add(relatives2); |
||||||
relatives2.setPerson2Bean(this); |
relatives2.setPerson2Bean(this); |
||||||
|
|
||||||
return relatives2; |
return relatives2; |
||||||
} |
} |
||||||
|
|
||||||
public Relative removeRelatives2(Relative relatives2) { |
public Relative removeRelatives2(Relative relatives2) { |
||||||
getRelatives2().remove(relatives2); |
getRelatives2().remove(relatives2); |
||||||
relatives2.setPerson2Bean(null); |
relatives2.setPerson2Bean(null); |
||||||
|
|
||||||
return relatives2; |
return relatives2; |
||||||
} |
} |
||||||
|
|
||||||
public List<Startpaesse> getStartpaesses() { |
public List<Startpaesse> getStartpaesses() { |
||||||
return this.startpaesses; |
return this.startpaesses; |
||||||
} |
} |
||||||
|
|
||||||
public void setStartpaesses(List<Startpaesse> startpaesses) { |
public void setStartpaesses(List<Startpaesse> startpaesses) { |
||||||
this.startpaesses = startpaesses; |
this.startpaesses = startpaesses; |
||||||
} |
} |
||||||
|
|
||||||
public Startpaesse addStartpaess(Startpaesse startpaess) { |
public Startpaesse addStartpaess(Startpaesse startpaess) { |
||||||
getStartpaesses().add(startpaess); |
getStartpaesses().add(startpaess); |
||||||
startpaess.setPerson(this); |
startpaess.setPerson(this); |
||||||
|
|
||||||
return startpaess; |
return startpaess; |
||||||
} |
} |
||||||
|
|
||||||
public Startpaesse removeStartpaess(Startpaesse startpaess) { |
public Startpaesse removeStartpaess(Startpaesse startpaess) { |
||||||
getStartpaesses().remove(startpaess); |
getStartpaesses().remove(startpaess); |
||||||
startpaess.setPerson(null); |
startpaess.setPerson(null); |
||||||
return startpaess; |
return startpaess; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int hashCode() { |
public int hashCode() { |
||||||
final int prime = 31; |
final int prime = 31; |
||||||
int result = 1; |
int result = 1; |
||||||
result = prime * result + ((created == null) ? 0 : created.hashCode()); |
result = prime * result + ((created == null) ? 0 : created.hashCode()); |
||||||
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
||||||
result = prime * result + id; |
result = prime * result + id; |
||||||
result = prime * result + ((prename == null) ? 0 : prename.hashCode()); |
result = prime * result + ((prename == null) ? 0 : prename.hashCode()); |
||||||
result = prime * result + ((surname == null) ? 0 : surname.hashCode()); |
result = prime * result + ((surname == null) ? 0 : surname.hashCode()); |
||||||
result = prime * result + ((username == null) ? 0 : username.hashCode()); |
result = prime * result + ((username == null) ? 0 : username.hashCode()); |
||||||
return result; |
return result; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public boolean equals(Object obj) { |
public boolean equals(Object obj) { |
||||||
if (this == obj) |
if (this == obj) |
||||||
return true; |
return true; |
||||||
if (obj == null) |
if (obj == null) |
||||||
return false; |
return false; |
||||||
if (getClass() != obj.getClass()) |
if (getClass() != obj.getClass()) |
||||||
return false; |
return false; |
||||||
Person other = (Person) obj; |
Person other = (Person) obj; |
||||||
if (created == null) { |
if (created == null) { |
||||||
if (other.created != null) |
if (other.created != null) |
||||||
return false; |
return false; |
||||||
} else if (!created.equals(other.created)) |
} else if (!created.equals(other.created)) |
||||||
return false; |
return false; |
||||||
if (deleted == null) { |
if (deleted == null) { |
||||||
if (other.deleted != null) |
if (other.deleted != null) |
||||||
return false; |
return false; |
||||||
} else if (!deleted.equals(other.deleted)) |
} else if (!deleted.equals(other.deleted)) |
||||||
return false; |
return false; |
||||||
if (id != other.id) |
if (id != other.id) |
||||||
return false; |
return false; |
||||||
if (prename == null) { |
if (prename == null) { |
||||||
if (other.prename != null) |
if (other.prename != null) |
||||||
return false; |
return false; |
||||||
} else if (!prename.equals(other.prename)) |
} else if (!prename.equals(other.prename)) |
||||||
return false; |
return false; |
||||||
if (surname == null) { |
if (surname == null) { |
||||||
if (other.surname != null) |
if (other.surname != null) |
||||||
return false; |
return false; |
||||||
} else if (!surname.equals(other.surname)) |
} else if (!surname.equals(other.surname)) |
||||||
return false; |
return false; |
||||||
if (username == null) { |
if (username == null) { |
||||||
if (other.username != null) |
if (other.username != null) |
||||||
return false; |
return false; |
||||||
} else if (!username.equals(other.username)) |
} else if (!username.equals(other.username)) |
||||||
return false; |
return false; |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public String toString() { |
public String toString() { |
||||||
return "Person [id=" + id + ", prename=" + prename + ", surname=" + surname + "]"; |
return "Person [id=" + id + ", prename=" + prename + ", surname=" + surname + "]"; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
@ -1,131 +1,131 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||||
|
|
||||||
import java.io.Serializable; |
import java.io.Serializable; |
||||||
import javax.persistence.*; |
import javax.persistence.*; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
|
|
||||||
|
|
||||||
/** |
/** |
||||||
* The persistent class for the persongroup database table. |
* The persistent class for the persongroup database table. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
@Entity |
@Entity |
||||||
@Table(name="persongroup") |
@Table(name="persongroup") |
||||||
@NamedQuery(name="Persongroup.findAll", query="SELECT p FROM Persongroup p") |
@NamedQuery(name="Persongroup.findAll", query="SELECT p FROM Persongroup p") |
||||||
public class Persongroup implements Serializable { |
public class Persongroup implements Serializable { |
||||||
private static final long serialVersionUID = 1L; |
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
@Id |
@Id |
||||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||||
private int id; |
private int id; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date changed; |
private Date changed; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date created; |
private Date created; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date deleted; |
private Date deleted; |
||||||
|
|
||||||
//bi-directional many-to-one association to Person
|
//bi-directional many-to-one association to Person
|
||||||
@ManyToOne |
@ManyToOne |
||||||
private Person person; |
private Person person; |
||||||
|
|
||||||
//bi-directional many-to-one association to GroupDef
|
//bi-directional many-to-one association to GroupDef
|
||||||
@ManyToOne |
@ManyToOne |
||||||
@JoinColumn(name="group_id") |
@JoinColumn(name="group_id") |
||||||
private GroupDef groupDef; |
private GroupDef groupDef; |
||||||
|
|
||||||
public Persongroup() { |
public Persongroup() { |
||||||
} |
} |
||||||
|
|
||||||
public int getId() { |
public int getId() { |
||||||
return this.id; |
return this.id; |
||||||
} |
} |
||||||
|
|
||||||
public void setId(int id) { |
public void setId(int id) { |
||||||
this.id = id; |
this.id = id; |
||||||
} |
} |
||||||
|
|
||||||
public Date getChanged() { |
public Date getChanged() { |
||||||
return this.changed; |
return this.changed; |
||||||
} |
} |
||||||
|
|
||||||
public void setChanged(Date changed) { |
public void setChanged(Date changed) { |
||||||
this.changed = changed; |
this.changed = changed; |
||||||
} |
} |
||||||
|
|
||||||
public Date getCreated() { |
public Date getCreated() { |
||||||
return this.created; |
return this.created; |
||||||
} |
} |
||||||
|
|
||||||
public void setCreated(Date created) { |
public void setCreated(Date created) { |
||||||
this.created = created; |
this.created = created; |
||||||
} |
} |
||||||
|
|
||||||
public Date getDeleted() { |
public Date getDeleted() { |
||||||
return this.deleted; |
return this.deleted; |
||||||
} |
} |
||||||
|
|
||||||
public void setDeleted(Date deleted) { |
public void setDeleted(Date deleted) { |
||||||
this.deleted = deleted; |
this.deleted = deleted; |
||||||
} |
} |
||||||
|
|
||||||
public Person getPerson() { |
public Person getPerson() { |
||||||
return this.person; |
return this.person; |
||||||
} |
} |
||||||
|
|
||||||
public void setPerson(Person person) { |
public void setPerson(Person person) { |
||||||
this.person = person; |
this.person = person; |
||||||
} |
} |
||||||
|
|
||||||
public GroupDef getGroupDef() { |
public GroupDef getGroupDef() { |
||||||
return this.groupDef; |
return this.groupDef; |
||||||
} |
} |
||||||
|
|
||||||
public void setGroupDef(GroupDef groupDef) { |
public void setGroupDef(GroupDef groupDef) { |
||||||
this.groupDef = groupDef; |
this.groupDef = groupDef; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int hashCode() { |
public int hashCode() { |
||||||
final int prime = 31; |
final int prime = 31; |
||||||
int result = 1; |
int result = 1; |
||||||
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
||||||
result = prime * result + ((groupDef == null) ? 0 : groupDef.hashCode()); |
result = prime * result + ((groupDef == null) ? 0 : groupDef.hashCode()); |
||||||
result = prime * result + id; |
result = prime * result + id; |
||||||
result = prime * result + ((person == null) ? 0 : person.hashCode()); |
result = prime * result + ((person == null) ? 0 : person.hashCode()); |
||||||
return result; |
return result; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public boolean equals(Object obj) { |
public boolean equals(Object obj) { |
||||||
if (this == obj) |
if (this == obj) |
||||||
return true; |
return true; |
||||||
if (obj == null) |
if (obj == null) |
||||||
return false; |
return false; |
||||||
if (getClass() != obj.getClass()) |
if (getClass() != obj.getClass()) |
||||||
return false; |
return false; |
||||||
Persongroup other = (Persongroup) obj; |
Persongroup other = (Persongroup) obj; |
||||||
if (deleted == null) { |
if (deleted == null) { |
||||||
if (other.deleted != null) |
if (other.deleted != null) |
||||||
return false; |
return false; |
||||||
} else if (!deleted.equals(other.deleted)) |
} else if (!deleted.equals(other.deleted)) |
||||||
return false; |
return false; |
||||||
if (groupDef == null) { |
if (groupDef == null) { |
||||||
if (other.groupDef != null) |
if (other.groupDef != null) |
||||||
return false; |
return false; |
||||||
} else if (!groupDef.equals(other.groupDef)) |
} else if (!groupDef.equals(other.groupDef)) |
||||||
return false; |
return false; |
||||||
if (id != other.id) |
if (id != other.id) |
||||||
return false; |
return false; |
||||||
if (person == null) { |
if (person == null) { |
||||||
if (other.person != null) |
if (other.person != null) |
||||||
return false; |
return false; |
||||||
} else if (!person.equals(other.person)) |
} else if (!person.equals(other.person)) |
||||||
return false; |
return false; |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
@ -1,166 +1,166 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||||
|
|
||||||
import java.io.Serializable; |
import java.io.Serializable; |
||||||
import javax.persistence.*; |
import javax.persistence.*; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
|
|
||||||
|
|
||||||
/** |
/** |
||||||
* The persistent class for the relative database table. |
* The persistent class for the relative database table. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
@Entity |
@Entity |
||||||
@Table(name="relative") |
@Table(name="relative") |
||||||
@NamedQuery(name="Relative.findAll", query="SELECT r FROM Relative r") |
@NamedQuery(name="Relative.findAll", query="SELECT r FROM Relative r") |
||||||
public class Relative implements Serializable { |
public class Relative implements Serializable { |
||||||
private static final long serialVersionUID = 1L; |
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
@Id |
@Id |
||||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||||
private int id; |
private int id; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date changed; |
private Date changed; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date created; |
private Date created; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date deleted; |
private Date deleted; |
||||||
|
|
||||||
@Column(name="TO_PERSON1_RELATION") |
@Column(name="TO_PERSON1_RELATION") |
||||||
private String toPerson1Relation; |
private String toPerson1Relation; |
||||||
|
|
||||||
@Column(name="TO_PERSON2_RELATION") |
@Column(name="TO_PERSON2_RELATION") |
||||||
private String toPerson2Relation; |
private String toPerson2Relation; |
||||||
|
|
||||||
//bi-directional many-to-one association to Person
|
//bi-directional many-to-one association to Person
|
||||||
@ManyToOne |
@ManyToOne |
||||||
@JoinColumn(name="person1") |
@JoinColumn(name="person1") |
||||||
private Person person1Bean; |
private Person person1Bean; |
||||||
|
|
||||||
//bi-directional many-to-one association to Person
|
//bi-directional many-to-one association to Person
|
||||||
@ManyToOne |
@ManyToOne |
||||||
@JoinColumn(name="person2") |
@JoinColumn(name="person2") |
||||||
private Person person2Bean; |
private Person person2Bean; |
||||||
|
|
||||||
public Relative() { |
public Relative() { |
||||||
} |
} |
||||||
|
|
||||||
public int getId() { |
public int getId() { |
||||||
return this.id; |
return this.id; |
||||||
} |
} |
||||||
|
|
||||||
public void setId(int id) { |
public void setId(int id) { |
||||||
this.id = id; |
this.id = id; |
||||||
} |
} |
||||||
|
|
||||||
public Date getChanged() { |
public Date getChanged() { |
||||||
return this.changed; |
return this.changed; |
||||||
} |
} |
||||||
|
|
||||||
public void setChanged(Date changed) { |
public void setChanged(Date changed) { |
||||||
this.changed = changed; |
this.changed = changed; |
||||||
} |
} |
||||||
|
|
||||||
public Date getCreated() { |
public Date getCreated() { |
||||||
return this.created; |
return this.created; |
||||||
} |
} |
||||||
|
|
||||||
public void setCreated(Date created) { |
public void setCreated(Date created) { |
||||||
this.created = created; |
this.created = created; |
||||||
} |
} |
||||||
|
|
||||||
public Date getDeleted() { |
public Date getDeleted() { |
||||||
return this.deleted; |
return this.deleted; |
||||||
} |
} |
||||||
|
|
||||||
public void setDeleted(Date deleted) { |
public void setDeleted(Date deleted) { |
||||||
this.deleted = deleted; |
this.deleted = deleted; |
||||||
} |
} |
||||||
|
|
||||||
public String getToPerson1Relation() { |
public String getToPerson1Relation() { |
||||||
return this.toPerson1Relation; |
return this.toPerson1Relation; |
||||||
} |
} |
||||||
|
|
||||||
public void setToPerson1Relation(String toPerson1Relation) { |
public void setToPerson1Relation(String toPerson1Relation) { |
||||||
this.toPerson1Relation = toPerson1Relation; |
this.toPerson1Relation = toPerson1Relation; |
||||||
} |
} |
||||||
|
|
||||||
public String getToPerson2Relation() { |
public String getToPerson2Relation() { |
||||||
return this.toPerson2Relation; |
return this.toPerson2Relation; |
||||||
} |
} |
||||||
|
|
||||||
public void setToPerson2Relation(String toPerson2Relation) { |
public void setToPerson2Relation(String toPerson2Relation) { |
||||||
this.toPerson2Relation = toPerson2Relation; |
this.toPerson2Relation = toPerson2Relation; |
||||||
} |
} |
||||||
|
|
||||||
public Person getPerson1Bean() { |
public Person getPerson1Bean() { |
||||||
return this.person1Bean; |
return this.person1Bean; |
||||||
} |
} |
||||||
|
|
||||||
public void setPerson1Bean(Person person1Bean) { |
public void setPerson1Bean(Person person1Bean) { |
||||||
this.person1Bean = person1Bean; |
this.person1Bean = person1Bean; |
||||||
} |
} |
||||||
|
|
||||||
public Person getPerson2Bean() { |
public Person getPerson2Bean() { |
||||||
return this.person2Bean; |
return this.person2Bean; |
||||||
} |
} |
||||||
|
|
||||||
public void setPerson2Bean(Person person2Bean) { |
public void setPerson2Bean(Person person2Bean) { |
||||||
this.person2Bean = person2Bean; |
this.person2Bean = person2Bean; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int hashCode() { |
public int hashCode() { |
||||||
final int prime = 31; |
final int prime = 31; |
||||||
int result = 1; |
int result = 1; |
||||||
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
||||||
result = prime * result + id; |
result = prime * result + id; |
||||||
result = prime * result + ((person1Bean == null) ? 0 : person1Bean.hashCode()); |
result = prime * result + ((person1Bean == null) ? 0 : person1Bean.hashCode()); |
||||||
result = prime * result + ((person2Bean == null) ? 0 : person2Bean.hashCode()); |
result = prime * result + ((person2Bean == null) ? 0 : person2Bean.hashCode()); |
||||||
result = prime * result + ((toPerson1Relation == null) ? 0 : toPerson1Relation.hashCode()); |
result = prime * result + ((toPerson1Relation == null) ? 0 : toPerson1Relation.hashCode()); |
||||||
result = prime * result + ((toPerson2Relation == null) ? 0 : toPerson2Relation.hashCode()); |
result = prime * result + ((toPerson2Relation == null) ? 0 : toPerson2Relation.hashCode()); |
||||||
return result; |
return result; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public boolean equals(Object obj) { |
public boolean equals(Object obj) { |
||||||
if (this == obj) |
if (this == obj) |
||||||
return true; |
return true; |
||||||
if (obj == null) |
if (obj == null) |
||||||
return false; |
return false; |
||||||
if (getClass() != obj.getClass()) |
if (getClass() != obj.getClass()) |
||||||
return false; |
return false; |
||||||
Relative other = (Relative) obj; |
Relative other = (Relative) obj; |
||||||
if (deleted == null) { |
if (deleted == null) { |
||||||
if (other.deleted != null) |
if (other.deleted != null) |
||||||
return false; |
return false; |
||||||
} else if (!deleted.equals(other.deleted)) |
} else if (!deleted.equals(other.deleted)) |
||||||
return false; |
return false; |
||||||
if (id != other.id) |
if (id != other.id) |
||||||
return false; |
return false; |
||||||
if (person1Bean == null) { |
if (person1Bean == null) { |
||||||
if (other.person1Bean != null) |
if (other.person1Bean != null) |
||||||
return false; |
return false; |
||||||
} else if (!person1Bean.equals(other.person1Bean)) |
} else if (!person1Bean.equals(other.person1Bean)) |
||||||
return false; |
return false; |
||||||
if (person2Bean == null) { |
if (person2Bean == null) { |
||||||
if (other.person2Bean != null) |
if (other.person2Bean != null) |
||||||
return false; |
return false; |
||||||
} else if (!person2Bean.equals(other.person2Bean)) |
} else if (!person2Bean.equals(other.person2Bean)) |
||||||
return false; |
return false; |
||||||
if (toPerson1Relation == null) { |
if (toPerson1Relation == null) { |
||||||
if (other.toPerson1Relation != null) |
if (other.toPerson1Relation != null) |
||||||
return false; |
return false; |
||||||
} else if (!toPerson1Relation.equals(other.toPerson1Relation)) |
} else if (!toPerson1Relation.equals(other.toPerson1Relation)) |
||||||
return false; |
return false; |
||||||
if (toPerson2Relation == null) { |
if (toPerson2Relation == null) { |
||||||
if (other.toPerson2Relation != null) |
if (other.toPerson2Relation != null) |
||||||
return false; |
return false; |
||||||
} else if (!toPerson2Relation.equals(other.toPerson2Relation)) |
} else if (!toPerson2Relation.equals(other.toPerson2Relation)) |
||||||
return false; |
return false; |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
@ -1,162 +1,162 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||||
|
|
||||||
import java.io.Serializable; |
import java.io.Serializable; |
||||||
import javax.persistence.*; |
import javax.persistence.*; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
/** |
/** |
||||||
* The persistent class for the startpaesse database table. |
* The persistent class for the startpaesse database table. |
||||||
* |
* |
||||||
*/ |
*/ |
||||||
@Entity |
@Entity |
||||||
@Table(name="startpaesse") |
@Table(name="startpaesse") |
||||||
@NamedQuery(name="Startpaesse.findAll", query="SELECT s FROM Startpaesse s") |
@NamedQuery(name="Startpaesse.findAll", query="SELECT s FROM Startpaesse s") |
||||||
public class Startpaesse implements Serializable { |
public class Startpaesse implements Serializable { |
||||||
private static final long serialVersionUID = 1L; |
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
@Id |
@Id |
||||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||||
private int id; |
private int id; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date changed; |
private Date changed; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date created; |
private Date created; |
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP) |
@Temporal(TemporalType.TIMESTAMP) |
||||||
private Date deleted; |
private Date deleted; |
||||||
|
|
||||||
@Column(name="startpass_nr") |
@Column(name="startpass_nr") |
||||||
private String startpassNr; |
private String startpassNr; |
||||||
|
|
||||||
//bi-directional many-to-one association to Person
|
//bi-directional many-to-one association to Person
|
||||||
@ManyToOne |
@ManyToOne |
||||||
private Person person; |
private Person person; |
||||||
|
|
||||||
//bi-directional many-to-one association to StartpassStartrechte
|
//bi-directional many-to-one association to StartpassStartrechte
|
||||||
@OneToMany(mappedBy="startpaesse") |
@OneToMany(mappedBy="startpaesse") |
||||||
private List<StartpassStartrechte> startpassStartrechtes; |
private List<StartpassStartrechte> startpassStartrechtes; |
||||||
|
|
||||||
public Startpaesse() { |
public Startpaesse() { |
||||||
} |
} |
||||||
|
|
||||||
public int getId() { |
public int getId() { |
||||||
return this.id; |
return this.id; |
||||||
} |
} |
||||||
|
|
||||||
public void setId(int id) { |
public void setId(int id) { |
||||||
this.id = id; |
this.id = id; |
||||||
} |
} |
||||||
|
|
||||||
public Date getChanged() { |
public Date getChanged() { |
||||||
return this.changed; |
return this.changed; |
||||||
} |
} |
||||||
|
|
||||||
public void setChanged(Date changed) { |
public void setChanged(Date changed) { |
||||||
this.changed = changed; |
this.changed = changed; |
||||||
} |
} |
||||||
|
|
||||||
public Date getCreated() { |
public Date getCreated() { |
||||||
return this.created; |
return this.created; |
||||||
} |
} |
||||||
|
|
||||||
public void setCreated(Date created) { |
public void setCreated(Date created) { |
||||||
this.created = created; |
this.created = created; |
||||||
} |
} |
||||||
|
|
||||||
public Date getDeleted() { |
public Date getDeleted() { |
||||||
return this.deleted; |
return this.deleted; |
||||||
} |
} |
||||||
|
|
||||||
public void setDeleted(Date deleted) { |
public void setDeleted(Date deleted) { |
||||||
this.deleted = deleted; |
this.deleted = deleted; |
||||||
} |
} |
||||||
|
|
||||||
public String getStartpassNr() { |
public String getStartpassNr() { |
||||||
return this.startpassNr; |
return this.startpassNr; |
||||||
} |
} |
||||||
|
|
||||||
public void setStartpassNr(String startpassNr) { |
public void setStartpassNr(String startpassNr) { |
||||||
this.startpassNr = startpassNr; |
this.startpassNr = startpassNr; |
||||||
} |
} |
||||||
|
|
||||||
public Person getPerson() { |
public Person getPerson() { |
||||||
return this.person; |
return this.person; |
||||||
} |
} |
||||||
|
|
||||||
public void setPerson(Person person) { |
public void setPerson(Person person) { |
||||||
this.person = person; |
this.person = person; |
||||||
} |
} |
||||||
|
|
||||||
public List<StartpassStartrechte> getStartpassStartrechtes() { |
public List<StartpassStartrechte> getStartpassStartrechtes() { |
||||||
return this.startpassStartrechtes; |
return this.startpassStartrechtes; |
||||||
} |
} |
||||||
|
|
||||||
public void setStartpassStartrechtes(List<StartpassStartrechte> startpassStartrechtes) { |
public void setStartpassStartrechtes(List<StartpassStartrechte> startpassStartrechtes) { |
||||||
this.startpassStartrechtes = startpassStartrechtes; |
this.startpassStartrechtes = startpassStartrechtes; |
||||||
} |
} |
||||||
|
|
||||||
public StartpassStartrechte addStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
public StartpassStartrechte addStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
||||||
getStartpassStartrechtes().add(startpassStartrechte); |
getStartpassStartrechtes().add(startpassStartrechte); |
||||||
startpassStartrechte.setStartpaesse(this); |
startpassStartrechte.setStartpaesse(this); |
||||||
|
|
||||||
return startpassStartrechte; |
return startpassStartrechte; |
||||||
} |
} |
||||||
|
|
||||||
public StartpassStartrechte removeStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
public StartpassStartrechte removeStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
||||||
getStartpassStartrechtes().remove(startpassStartrechte); |
getStartpassStartrechtes().remove(startpassStartrechte); |
||||||
startpassStartrechte.setStartpaesse(null); |
startpassStartrechte.setStartpaesse(null); |
||||||
|
|
||||||
return startpassStartrechte; |
return startpassStartrechte; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int hashCode() { |
public int hashCode() { |
||||||
final int prime = 31; |
final int prime = 31; |
||||||
int result = 1; |
int result = 1; |
||||||
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
result = prime * result + ((deleted == null) ? 0 : deleted.hashCode()); |
||||||
result = prime * result + id; |
result = prime * result + id; |
||||||
result = prime * result + ((person == null) ? 0 : person.hashCode()); |
result = prime * result + ((person == null) ? 0 : person.hashCode()); |
||||||
result = prime * result + ((startpassNr == null) ? 0 : startpassNr.hashCode()); |
result = prime * result + ((startpassNr == null) ? 0 : startpassNr.hashCode()); |
||||||
result = prime * result + ((startpassStartrechtes == null) ? 0 : startpassStartrechtes.hashCode()); |
result = prime * result + ((startpassStartrechtes == null) ? 0 : startpassStartrechtes.hashCode()); |
||||||
return result; |
return result; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
||||||
public boolean equals(Object obj) { |
public boolean equals(Object obj) { |
||||||
if (this == obj) |
if (this == obj) |
||||||
return true; |
return true; |
||||||
if (obj == null) |
if (obj == null) |
||||||
return false; |
return false; |
||||||
if (getClass() != obj.getClass()) |
if (getClass() != obj.getClass()) |
||||||
return false; |
return false; |
||||||
Startpaesse other = (Startpaesse) obj; |
Startpaesse other = (Startpaesse) obj; |
||||||
if (deleted == null) { |
if (deleted == null) { |
||||||
if (other.deleted != null) |
if (other.deleted != null) |
||||||
return false; |
return false; |
||||||
} else if (!deleted.equals(other.deleted)) |
} else if (!deleted.equals(other.deleted)) |
||||||
return false; |
return false; |
||||||
if (id != other.id) |
if (id != other.id) |
||||||
return false; |
return false; |
||||||
if (person == null) { |
if (person == null) { |
||||||
if (other.person != null) |
if (other.person != null) |
||||||
return false; |
return false; |
||||||
} else if (!person.equals(other.person)) |
} else if (!person.equals(other.person)) |
||||||
return false; |
return false; |
||||||
if (startpassNr == null) { |
if (startpassNr == null) { |
||||||
if (other.startpassNr != null) |
if (other.startpassNr != null) |
||||||
return false; |
return false; |
||||||
} else if (!startpassNr.equals(other.startpassNr)) |
} else if (!startpassNr.equals(other.startpassNr)) |
||||||
return false; |
return false; |
||||||
if (startpassStartrechtes == null) { |
if (startpassStartrechtes == null) { |
||||||
if (other.startpassStartrechtes != null) |
if (other.startpassStartrechtes != null) |
||||||
return false; |
return false; |
||||||
} else if (!startpassStartrechtes.equals(other.startpassStartrechtes)) |
} else if (!startpassStartrechtes.equals(other.startpassStartrechtes)) |
||||||
return false; |
return false; |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
@ -1,125 +1,125 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui; |
||||||
|
|
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
import java.util.concurrent.ExecutorService; |
import java.util.concurrent.ExecutorService; |
||||||
import java.util.concurrent.Executors; |
import java.util.concurrent.Executors; |
||||||
|
|
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
||||||
import org.springframework.beans.factory.annotation.Autowired; |
import org.springframework.beans.factory.annotation.Autowired; |
||||||
import org.vaadin.addon.calendar.ui.CalendarComponentEvents; |
import org.vaadin.addon.calendar.ui.CalendarComponentEvents; |
||||||
|
|
||||||
import com.vaadin.annotations.Push; |
import com.vaadin.annotations.Push; |
||||||
import com.vaadin.annotations.Theme; |
import com.vaadin.annotations.Theme; |
||||||
import com.vaadin.event.selection.SelectionEvent; |
import com.vaadin.event.selection.SelectionEvent; |
||||||
import com.vaadin.server.VaadinRequest; |
import com.vaadin.server.VaadinRequest; |
||||||
import com.vaadin.shared.communication.PushMode; |
import com.vaadin.shared.communication.PushMode; |
||||||
import com.vaadin.spring.annotation.SpringUI; |
import com.vaadin.spring.annotation.SpringUI; |
||||||
import com.vaadin.ui.HorizontalLayout; |
import com.vaadin.ui.HorizontalLayout; |
||||||
import com.vaadin.ui.UI; |
import com.vaadin.ui.UI; |
||||||
|
|
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventBusiness; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.business.EventBusiness; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.GroupDao; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.GroupDao; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.CalendarComponent; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.CalendarComponent; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.PersonEditDialog; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.PersonEditDialog; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.PersonGrid; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components.PersonGrid; |
||||||
|
|
||||||
@Theme("vaadin-clubhelpertheme") |
@Theme("vaadin-clubhelpertheme") |
||||||
@SpringUI |
@SpringUI |
||||||
@Push(value=PushMode.MANUAL) |
@Push(value=PushMode.MANUAL) |
||||||
public class MainUi extends UI { |
public class MainUi extends UI { |
||||||
|
|
||||||
private static final long serialVersionUID = 7581634188909841919L; |
private static final long serialVersionUID = 7581634188909841919L; |
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(MainUi.class); |
private static final Logger LOGGER = LoggerFactory.getLogger(MainUi.class); |
||||||
|
|
||||||
@Autowired |
@Autowired |
||||||
PersonDao personDao; |
PersonDao personDao; |
||||||
|
|
||||||
@Autowired |
@Autowired |
||||||
GroupDao groupDao; |
GroupDao groupDao; |
||||||
|
|
||||||
@Autowired |
@Autowired |
||||||
EventBusiness eventBusiness; |
EventBusiness eventBusiness; |
||||||
|
|
||||||
private PersonGrid personGrid; |
private PersonGrid personGrid; |
||||||
|
|
||||||
private CalendarComponent calendar; |
private CalendarComponent calendar; |
||||||
|
|
||||||
private HorizontalLayout contentLayout; |
private HorizontalLayout contentLayout; |
||||||
|
|
||||||
@Override |
@Override |
||||||
protected void init(VaadinRequest request) { |
protected void init(VaadinRequest request) { |
||||||
|
|
||||||
LOGGER.debug("Starting Vaadin UI with " + getClass().getName()); |
LOGGER.debug("Starting Vaadin UI with " + getClass().getName()); |
||||||
|
|
||||||
List<Person> persons = personDao.listAll(); |
List<Person> persons = personDao.listAll(); |
||||||
personGrid = new PersonGrid(groupDao); |
personGrid = new PersonGrid(groupDao); |
||||||
personGrid.setItems(persons); |
personGrid.setItems(persons); |
||||||
personGrid.setCaption("Personen"); |
personGrid.setCaption("Personen"); |
||||||
personGrid.onClosedFunction(() -> detailClosed()); |
personGrid.onClosedFunction(() -> detailClosed()); |
||||||
personGrid.onPersonSelect(ev -> personSelectionChange(ev)); |
personGrid.onPersonSelect(ev -> personSelectionChange(ev)); |
||||||
personGrid.onPersonEdit(p -> onPersonEdit(p)); |
personGrid.onPersonEdit(p -> onPersonEdit(p)); |
||||||
|
|
||||||
this.calendar = new CalendarComponent(); |
this.calendar = new CalendarComponent(); |
||||||
calendar.setHandler(this::onItemClick); |
calendar.setHandler(this::onItemClick); |
||||||
|
|
||||||
contentLayout = new HorizontalLayout(); |
contentLayout = new HorizontalLayout(); |
||||||
contentLayout.setSizeFull(); |
contentLayout.setSizeFull(); |
||||||
contentLayout.addComponents(calendar); |
contentLayout.addComponents(calendar); |
||||||
|
|
||||||
setContent(contentLayout); |
setContent(contentLayout); |
||||||
setSizeFull(); |
setSizeFull(); |
||||||
|
|
||||||
ExecutorService exec = Executors.newSingleThreadExecutor(); |
ExecutorService exec = Executors.newSingleThreadExecutor(); |
||||||
exec.execute(() -> { |
exec.execute(() -> { |
||||||
|
|
||||||
final List<ClubEvent> events = eventBusiness.loadEvents(request); |
final List<ClubEvent> events = eventBusiness.loadEvents(request); |
||||||
LOGGER.info("Loaded events: {}", events); |
LOGGER.info("Loaded events: {}", events); |
||||||
final UI ui = calendar.getUI(); |
final UI ui = calendar.getUI(); |
||||||
ui.access(() -> { |
ui.access(() -> { |
||||||
calendar.setItems(events); |
calendar.setItems(events); |
||||||
ui.push(); |
ui.push(); |
||||||
}); |
}); |
||||||
|
|
||||||
}); |
}); |
||||||
exec.shutdown(); |
exec.shutdown(); |
||||||
LOGGER.info("Loaded UI and started fetch of Events"); |
LOGGER.info("Loaded UI and started fetch of Events"); |
||||||
} |
} |
||||||
|
|
||||||
private void onPersonEdit(Person p) { |
private void onPersonEdit(Person p) { |
||||||
PersonEditDialog dlg = new PersonEditDialog(groupDao.listAll(), p, personDao); |
PersonEditDialog dlg = new PersonEditDialog(groupDao.listAll(), p, personDao); |
||||||
getUI().addWindow(dlg); |
getUI().addWindow(dlg); |
||||||
} |
} |
||||||
|
|
||||||
private void personSelectionChange(SelectionEvent<Person> ev) { |
private void personSelectionChange(SelectionEvent<Person> ev) { |
||||||
Set<Person> selected = ev.getAllSelectedItems(); |
Set<Person> selected = ev.getAllSelectedItems(); |
||||||
LOGGER.debug("Selection changed to: {}", selected); |
LOGGER.debug("Selection changed to: {}", selected); |
||||||
eventBusiness.changePersons(selected); |
eventBusiness.changePersons(selected); |
||||||
} |
} |
||||||
|
|
||||||
private void detailClosed() { |
private void detailClosed() { |
||||||
LOGGER.debug("Closing detail view."); |
LOGGER.debug("Closing detail view."); |
||||||
contentLayout.removeComponent(personGrid); |
contentLayout.removeComponent(personGrid); |
||||||
} |
} |
||||||
|
|
||||||
private void onItemClick(CalendarComponentEvents.ItemClickEvent event) { |
private void onItemClick(CalendarComponentEvents.ItemClickEvent event) { |
||||||
ClubEvent ev = (ClubEvent) event.getCalendarItem(); |
ClubEvent ev = (ClubEvent) event.getCalendarItem(); |
||||||
LOGGER.debug("Opening detail view for {}", ev); |
LOGGER.debug("Opening detail view for {}", ev); |
||||||
|
|
||||||
contentLayout.removeComponent(personGrid); |
contentLayout.removeComponent(personGrid); |
||||||
contentLayout.addComponent(personGrid); |
contentLayout.addComponent(personGrid); |
||||||
|
|
||||||
personGrid.setCaption(ev.getCaption()); |
personGrid.setCaption(ev.getCaption()); |
||||||
personGrid.setTitle(ev.getCaption()); |
personGrid.setTitle(ev.getCaption()); |
||||||
personGrid.setEnabled(false); |
personGrid.setEnabled(false); |
||||||
personGrid.selectItems(ev.getPersons()); |
personGrid.selectItems(ev.getPersons()); |
||||||
personGrid.setVisible(true); |
personGrid.setVisible(true); |
||||||
personGrid.setEnabled(true); |
personGrid.setEnabled(true); |
||||||
eventBusiness.setSelected(ev); |
eventBusiness.setSelected(ev); |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|||||||
@ -1,219 +1,219 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components; |
||||||
|
|
||||||
import java.text.DateFormat; |
import java.text.DateFormat; |
||||||
import java.util.ArrayList; |
import java.util.ArrayList; |
||||||
import java.util.Collection; |
import java.util.Collection; |
||||||
import java.util.HashSet; |
import java.util.HashSet; |
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
import java.util.function.Consumer; |
import java.util.function.Consumer; |
||||||
import java.util.function.Predicate; |
import java.util.function.Predicate; |
||||||
|
|
||||||
import org.slf4j.Logger; |
import org.slf4j.Logger; |
||||||
import org.slf4j.LoggerFactory; |
import org.slf4j.LoggerFactory; |
||||||
|
|
||||||
import com.vaadin.data.HasValue.ValueChangeEvent; |
import com.vaadin.data.HasValue.ValueChangeEvent; |
||||||
import com.vaadin.data.provider.ConfigurableFilterDataProvider; |
import com.vaadin.data.provider.ConfigurableFilterDataProvider; |
||||||
import com.vaadin.data.provider.ListDataProvider; |
import com.vaadin.data.provider.ListDataProvider; |
||||||
import com.vaadin.event.selection.SelectionListener; |
import com.vaadin.event.selection.SelectionListener; |
||||||
import com.vaadin.event.selection.SingleSelectionEvent; |
import com.vaadin.event.selection.SingleSelectionEvent; |
||||||
import com.vaadin.icons.VaadinIcons; |
import com.vaadin.icons.VaadinIcons; |
||||||
import com.vaadin.server.SerializablePredicate; |
import com.vaadin.server.SerializablePredicate; |
||||||
import com.vaadin.ui.Button; |
import com.vaadin.ui.Button; |
||||||
import com.vaadin.ui.CheckBox; |
import com.vaadin.ui.CheckBox; |
||||||
import com.vaadin.ui.ComboBox; |
import com.vaadin.ui.ComboBox; |
||||||
import com.vaadin.ui.CustomComponent; |
import com.vaadin.ui.CustomComponent; |
||||||
import com.vaadin.ui.Grid; |
import com.vaadin.ui.Grid; |
||||||
import com.vaadin.ui.Grid.SelectionMode; |
import com.vaadin.ui.Grid.SelectionMode; |
||||||
import com.vaadin.ui.HorizontalLayout; |
import com.vaadin.ui.HorizontalLayout; |
||||||
import com.vaadin.ui.MultiSelect; |
import com.vaadin.ui.MultiSelect; |
||||||
import com.vaadin.ui.TextField; |
import com.vaadin.ui.TextField; |
||||||
import com.vaadin.ui.VerticalLayout; |
import com.vaadin.ui.VerticalLayout; |
||||||
import com.vaadin.ui.themes.ValoTheme; |
import com.vaadin.ui.themes.ValoTheme; |
||||||
|
|
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.GroupDao; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.GroupDao; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.GroupDef; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||||
|
|
||||||
public class PersonGrid extends CustomComponent { |
public class PersonGrid extends CustomComponent { |
||||||
|
|
||||||
private static final long serialVersionUID = -8148097982839343673L; |
private static final long serialVersionUID = -8148097982839343673L; |
||||||
private final Logger log = LoggerFactory.getLogger(getClass()); |
private final Logger log = LoggerFactory.getLogger(getClass()); |
||||||
|
|
||||||
private final DateFormat birthFormat = DateFormat |
private final DateFormat birthFormat = DateFormat |
||||||
.getDateInstance(DateFormat.MEDIUM); |
.getDateInstance(DateFormat.MEDIUM); |
||||||
|
|
||||||
private final Grid<Person> grid; |
private final Grid<Person> grid; |
||||||
|
|
||||||
private final CheckBox checkIncluded; |
private final CheckBox checkIncluded; |
||||||
private final ComboBox<GroupDef> comboGroups; |
private final ComboBox<GroupDef> comboGroups; |
||||||
|
|
||||||
private final TextField textTitle; |
private final TextField textTitle; |
||||||
|
|
||||||
private ClosedFunction closedFunction = null; |
private ClosedFunction closedFunction = null; |
||||||
private ConfigurableFilterDataProvider<Person, Void, SerializablePredicate<Person>> dataProvider; |
private ConfigurableFilterDataProvider<Person, Void, SerializablePredicate<Person>> dataProvider; |
||||||
private Boolean selectedOnlyFilter; |
private Boolean selectedOnlyFilter; |
||||||
private Set<GroupDef> groupMemberFilter; |
private Set<GroupDef> groupMemberFilter; |
||||||
private List<GroupDef> allGroups; |
private List<GroupDef> allGroups; |
||||||
private Consumer<Person> onPersonEdit; |
private Consumer<Person> onPersonEdit; |
||||||
|
|
||||||
public PersonGrid(GroupDao groupDao) { |
public PersonGrid(GroupDao groupDao) { |
||||||
|
|
||||||
textTitle = new TextField(); |
textTitle = new TextField(); |
||||||
textTitle.setStyleName("title_label"); |
textTitle.setStyleName("title_label"); |
||||||
textTitle.setCaption("Veranstaltung"); |
textTitle.setCaption("Veranstaltung"); |
||||||
textTitle.setEnabled(false); |
textTitle.setEnabled(false); |
||||||
textTitle.setSizeFull(); |
textTitle.setSizeFull(); |
||||||
|
|
||||||
checkIncluded = new CheckBox("Nur gemeldete"); |
checkIncluded = new CheckBox("Nur gemeldete"); |
||||||
checkIncluded.addValueChangeListener(ev -> onSelectedOnly(ev)); |
checkIncluded.addValueChangeListener(ev -> onSelectedOnly(ev)); |
||||||
comboGroups = new ComboBox<>("Gruppenfilter"); |
comboGroups = new ComboBox<>("Gruppenfilter"); |
||||||
comboGroups.setEmptySelectionAllowed(true); |
comboGroups.setEmptySelectionAllowed(true); |
||||||
comboGroups.setEmptySelectionCaption("Alle"); |
comboGroups.setEmptySelectionCaption("Alle"); |
||||||
comboGroups.setItemCaptionGenerator(GroupDef::getName); |
comboGroups.setItemCaptionGenerator(GroupDef::getName); |
||||||
comboGroups.addSelectionListener(ev -> onGroupSelected(ev)); |
comboGroups.addSelectionListener(ev -> onGroupSelected(ev)); |
||||||
allGroups = groupDao.listAll(); |
allGroups = groupDao.listAll(); |
||||||
comboGroups.setItems(allGroups); |
comboGroups.setItems(allGroups); |
||||||
log.info("Loaded Groups: {}", allGroups); |
log.info("Loaded Groups: {}", allGroups); |
||||||
|
|
||||||
HorizontalLayout filters = new HorizontalLayout(); |
HorizontalLayout filters = new HorizontalLayout(); |
||||||
filters.addComponents(checkIncluded, comboGroups); |
filters.addComponents(checkIncluded, comboGroups); |
||||||
dataProvider = new ListDataProvider<Person>(new ArrayList<>()).withConfigurableFilter(); |
dataProvider = new ListDataProvider<Person>(new ArrayList<>()).withConfigurableFilter(); |
||||||
grid = new Grid<>(); |
grid = new Grid<>(); |
||||||
grid.setDataProvider(dataProvider); |
grid.setDataProvider(dataProvider); |
||||||
grid.addColumn(Person::getPrename).setCaption("Vorname"); |
grid.addColumn(Person::getPrename).setCaption("Vorname"); |
||||||
grid.addColumn(Person::getSurname).setCaption("Nachname"); |
grid.addColumn(Person::getSurname).setCaption("Nachname"); |
||||||
grid.addColumn(Person::getBirth, |
grid.addColumn(Person::getBirth, |
||||||
b -> b != null ? birthFormat.format(b) : "") |
b -> b != null ? birthFormat.format(b) : "") |
||||||
.setCaption("Geburtstag"); |
.setCaption("Geburtstag"); |
||||||
grid.addComponentColumn(this::buildDeleteButton); |
grid.addComponentColumn(this::buildDeleteButton); |
||||||
grid.setSelectionMode(SelectionMode.MULTI); |
grid.setSelectionMode(SelectionMode.MULTI); |
||||||
|
|
||||||
Button close = new Button("Schließen", ev -> { |
Button close = new Button("Schließen", ev -> { |
||||||
PersonGrid.this.setVisible(false); |
PersonGrid.this.setVisible(false); |
||||||
if (closedFunction != null) { |
if (closedFunction != null) { |
||||||
closedFunction.closed(); |
closedFunction.closed(); |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
|
||||||
VerticalLayout panel = new VerticalLayout(); |
VerticalLayout panel = new VerticalLayout(); |
||||||
panel.addComponents(textTitle, filters, grid, close); |
panel.addComponents(textTitle, filters, grid, close); |
||||||
setCompositionRoot(panel); |
setCompositionRoot(panel); |
||||||
} |
} |
||||||
|
|
||||||
private Button buildDeleteButton(Person p) { |
private Button buildDeleteButton(Person p) { |
||||||
Button button = new Button(VaadinIcons.EDIT); |
Button button = new Button(VaadinIcons.EDIT); |
||||||
button.addStyleName(ValoTheme.BUTTON_SMALL); |
button.addStyleName(ValoTheme.BUTTON_SMALL); |
||||||
button.addClickListener(e -> showPersonDetails(p)); |
button.addClickListener(e -> showPersonDetails(p)); |
||||||
return button; |
return button; |
||||||
} |
} |
||||||
|
|
||||||
private void showPersonDetails(Person p) { |
private void showPersonDetails(Person p) { |
||||||
if (onPersonEdit != null) { |
if (onPersonEdit != null) { |
||||||
onPersonEdit.accept(p); |
onPersonEdit.accept(p); |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
public void onClosedFunction(ClosedFunction closedFunction) { |
public void onClosedFunction(ClosedFunction closedFunction) { |
||||||
this.closedFunction = closedFunction; |
this.closedFunction = closedFunction; |
||||||
} |
} |
||||||
|
|
||||||
private void onSelectedOnly(ValueChangeEvent<Boolean> ev) { |
private void onSelectedOnly(ValueChangeEvent<Boolean> ev) { |
||||||
this.selectedOnlyFilter = ev.getValue(); |
this.selectedOnlyFilter = ev.getValue(); |
||||||
updateFilter(); |
updateFilter(); |
||||||
} |
} |
||||||
|
|
||||||
private void updateFilter() { |
private void updateFilter() { |
||||||
Predicate<Person> filter = p -> true; |
Predicate<Person> filter = p -> true; |
||||||
if (selectedOnlyFilter!= null && selectedOnlyFilter.equals(Boolean.TRUE)) { |
if (selectedOnlyFilter!= null && selectedOnlyFilter.equals(Boolean.TRUE)) { |
||||||
Set<Person> selected = grid.getSelectedItems(); |
Set<Person> selected = grid.getSelectedItems(); |
||||||
filter = p -> selected.contains(p); |
filter = p -> selected.contains(p); |
||||||
} |
} |
||||||
if (groupMemberFilter != null && groupMemberFilter.isEmpty() == false) { |
if (groupMemberFilter != null && groupMemberFilter.isEmpty() == false) { |
||||||
final Set<Integer> groupIds = new HashSet<>(); |
final Set<Integer> groupIds = new HashSet<>(); |
||||||
groupMemberFilter.forEach(gm -> { |
groupMemberFilter.forEach(gm -> { |
||||||
groupIds.add(gm.getId()); |
groupIds.add(gm.getId()); |
||||||
}); |
}); |
||||||
|
|
||||||
filter = filter.and(p -> { |
filter = filter.and(p -> { |
||||||
{ |
{ |
||||||
List<GroupDef> personGroups = p.getPersongroups(); |
List<GroupDef> personGroups = p.getPersongroups(); |
||||||
for (GroupDef pg : personGroups) { |
for (GroupDef pg : personGroups) { |
||||||
if (groupIds.contains(pg.getId())) { |
if (groupIds.contains(pg.getId())) { |
||||||
return true; |
return true; |
||||||
} |
} |
||||||
} |
} |
||||||
return false; |
return false; |
||||||
} |
} |
||||||
}); |
}); |
||||||
} |
} |
||||||
|
|
||||||
setFilter(filter); |
setFilter(filter); |
||||||
} |
} |
||||||
|
|
||||||
public void setFilter(Predicate<Person> filter) { |
public void setFilter(Predicate<Person> filter) { |
||||||
dataProvider.setFilter(p -> filter.test(p)); |
dataProvider.setFilter(p -> filter.test(p)); |
||||||
grid.getDataProvider().refreshAll(); |
grid.getDataProvider().refreshAll(); |
||||||
} |
} |
||||||
|
|
||||||
public void onPersonSelect(SelectionListener<Person> listener) throws UnsupportedOperationException { |
public void onPersonSelect(SelectionListener<Person> listener) throws UnsupportedOperationException { |
||||||
grid.addSelectionListener(listener); |
grid.addSelectionListener(listener); |
||||||
} |
} |
||||||
|
|
||||||
public void selectItems(Person... items) { |
public void selectItems(Person... items) { |
||||||
MultiSelect<Person> asMultiSelect = grid.asMultiSelect(); |
MultiSelect<Person> asMultiSelect = grid.asMultiSelect(); |
||||||
asMultiSelect.deselectAll(); |
asMultiSelect.deselectAll(); |
||||||
asMultiSelect.select(items); |
asMultiSelect.select(items); |
||||||
} |
} |
||||||
|
|
||||||
public void deselectItems(Person... items) { |
public void deselectItems(Person... items) { |
||||||
grid.asMultiSelect().deselect(items); |
grid.asMultiSelect().deselect(items); |
||||||
} |
} |
||||||
|
|
||||||
public void select(Person item) { |
public void select(Person item) { |
||||||
grid.select(item); |
grid.select(item); |
||||||
} |
} |
||||||
|
|
||||||
public void deselect(Person item) { |
public void deselect(Person item) { |
||||||
grid.deselect(item); |
grid.deselect(item); |
||||||
} |
} |
||||||
|
|
||||||
public void deselectAll() { |
public void deselectAll() { |
||||||
grid.deselectAll(); |
grid.deselectAll(); |
||||||
} |
} |
||||||
|
|
||||||
private void onGroupSelected(SingleSelectionEvent<GroupDef> ev) { |
private void onGroupSelected(SingleSelectionEvent<GroupDef> ev) { |
||||||
|
|
||||||
groupMemberFilter = ev.getAllSelectedItems(); |
groupMemberFilter = ev.getAllSelectedItems(); |
||||||
updateFilter(); |
updateFilter(); |
||||||
} |
} |
||||||
|
|
||||||
public void setTitle(String value) { |
public void setTitle(String value) { |
||||||
if (value == null) { |
if (value == null) { |
||||||
value = ""; |
value = ""; |
||||||
} |
} |
||||||
textTitle.setValue(value); |
textTitle.setValue(value); |
||||||
} |
} |
||||||
|
|
||||||
public void setItems(Collection<Person> items) { |
public void setItems(Collection<Person> items) { |
||||||
grid.setItems(items); |
grid.setItems(items); |
||||||
} |
} |
||||||
|
|
||||||
public void setItems(Person... items) { |
public void setItems(Person... items) { |
||||||
grid.setItems(items); |
grid.setItems(items); |
||||||
} |
} |
||||||
|
|
||||||
public interface ClosedFunction { |
public interface ClosedFunction { |
||||||
void closed(); |
void closed(); |
||||||
} |
} |
||||||
|
|
||||||
public void selectItems(Collection<Person> persons) { |
public void selectItems(Collection<Person> persons) { |
||||||
log.debug("Selecting now: {}" + persons); |
log.debug("Selecting now: {}" + persons); |
||||||
selectItems(persons.toArray(new Person[0])); |
selectItems(persons.toArray(new Person[0])); |
||||||
} |
} |
||||||
|
|
||||||
public void onPersonEdit(Consumer<Person> function) { |
public void onPersonEdit(Consumer<Person> function) { |
||||||
this.onPersonEdit = function; |
this.onPersonEdit = function; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|||||||
@ -1,22 +1,22 @@ |
|||||||
<?xml version='1.0' encoding='UTF-8'?> |
<?xml version='1.0' encoding='UTF-8'?> |
||||||
<!DOCTYPE hibernate-configuration PUBLIC |
<!DOCTYPE hibernate-configuration PUBLIC |
||||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" |
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" |
||||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> |
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> |
||||||
|
|
||||||
<hibernate-configuration> |
<hibernate-configuration> |
||||||
<session-factory> |
<session-factory> |
||||||
<!-- SQL Dialect --> |
<!-- SQL Dialect --> |
||||||
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> |
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> |
||||||
|
|
||||||
<!-- Database Connection Settings --> |
<!-- Database Connection Settings --> |
||||||
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> |
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> |
||||||
<property name="hibernate.connection.datasource">java:comp/env/jdbc/clubhelperbackend</property> |
<property name="hibernate.connection.datasource">java:comp/env/jdbc/clubhelperbackend</property> |
||||||
<property name="cache.providerclass">org.hibernate.NoCacheProvider</property> |
<property name="cache.providerclass">org.hibernate.NoCacheProvider</property> |
||||||
<property name="show_sql">true</property> |
<property name="show_sql">true</property> |
||||||
|
|
||||||
<!-- Specifying Session Context --> |
<!-- Specifying Session Context --> |
||||||
<property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property> |
<property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property> |
||||||
|
|
||||||
<!-- <mapping resource="schema/ClubEvent.hbm.xml"></mapping> --> |
<!-- <mapping resource="schema/ClubEvent.hbm.xml"></mapping> --> |
||||||
</session-factory> |
</session-factory> |
||||||
</hibernate-configuration> |
</hibernate-configuration> |
||||||
|
|||||||
@ -1,36 +1,36 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" |
||||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
||||||
<hibernate-mapping> |
<hibernate-mapping> |
||||||
<class |
<class |
||||||
name="de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent" |
name="de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent" |
||||||
table="ClubEvent"> |
table="ClubEvent"> |
||||||
<id column="id" name="id" type="string" /> |
<id column="id" name="id" type="string" /> |
||||||
<property column="caption" generated="never" lazy="false" |
<property column="caption" generated="never" lazy="false" |
||||||
name="caption" type="string" /> |
name="caption" type="string" /> |
||||||
<property column="description" generated="never" lazy="false" |
<property column="description" generated="never" lazy="false" |
||||||
name="description" type="string" /> |
name="description" type="string" /> |
||||||
<property column="iCalUID" generated="never" lazy="false" |
<property column="iCalUID" generated="never" lazy="false" |
||||||
name="iCalUID" type="string" /> |
name="iCalUID" type="string" /> |
||||||
<property column="location" generated="never" lazy="false" |
<property column="location" generated="never" lazy="false" |
||||||
name="location" type="string" /> |
name="location" type="string" /> |
||||||
<property column="start" generated="never" lazy="false" |
<property column="start" generated="never" lazy="false" |
||||||
name="start" /> |
name="start" /> |
||||||
<property column="end" generated="never" lazy="false" |
<property column="end" generated="never" lazy="false" |
||||||
name="end" /> |
name="end" /> |
||||||
<property generated="never" lazy="false" |
<property generated="never" lazy="false" |
||||||
name="allDay"> |
name="allDay"> |
||||||
<column sql-type="BOOLEAN" not-null="true" name="allDay" /> |
<column sql-type="BOOLEAN" not-null="true" name="allDay" /> |
||||||
</property> |
</property> |
||||||
<property column="organizerDisplayName" generated="never" |
<property column="organizerDisplayName" generated="never" |
||||||
lazy="false" name="organizerDisplayName" type="string" /> |
lazy="false" name="organizerDisplayName" type="string" /> |
||||||
|
|
||||||
<set name="persons" table="clubevent_has_person" cascade="save-update" lazy="false"> |
<set name="persons" table="clubevent_has_person" cascade="save-update" lazy="false"> |
||||||
<key column="clubevent_id"/> |
<key column="clubevent_id"/> |
||||||
<many-to-many column="person_id" class="de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person" /> |
<many-to-many column="person_id" class="de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person" /> |
||||||
</set> |
</set> |
||||||
</class> |
</class> |
||||||
<query name="ClubEvent.findAll"> |
<query name="ClubEvent.findAll"> |
||||||
<![CDATA[from ClubEvent]]> |
<![CDATA[from ClubEvent]]> |
||||||
</query> |
</query> |
||||||
</hibernate-mapping> |
</hibernate-mapping> |
||||||
|
|||||||
@ -1,169 +1,169 @@ |
|||||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
||||||
|
|
||||||
import static org.junit.Assert.assertEquals; |
import static org.junit.Assert.assertEquals; |
||||||
import static org.junit.Assert.assertFalse; |
import static org.junit.Assert.assertFalse; |
||||||
import static org.junit.Assert.assertNotNull; |
import static org.junit.Assert.assertNotNull; |
||||||
import static org.junit.Assert.assertTrue; |
import static org.junit.Assert.assertTrue; |
||||||
|
|
||||||
import java.sql.Connection; |
import java.sql.Connection; |
||||||
import java.sql.ResultSet; |
import java.sql.ResultSet; |
||||||
import java.sql.SQLException; |
import java.sql.SQLException; |
||||||
import java.sql.Statement; |
import java.sql.Statement; |
||||||
import java.time.ZoneId; |
import java.time.ZoneId; |
||||||
import java.time.ZonedDateTime; |
import java.time.ZonedDateTime; |
||||||
import java.util.ArrayList; |
import java.util.ArrayList; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.HashSet; |
import java.util.HashSet; |
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
import java.util.concurrent.atomic.AtomicBoolean; |
import java.util.concurrent.atomic.AtomicBoolean; |
||||||
|
|
||||||
import org.hibernate.IdentifierLoadAccess; |
import org.hibernate.IdentifierLoadAccess; |
||||||
import org.hibernate.Transaction; |
import org.hibernate.Transaction; |
||||||
import org.hibernate.jdbc.Work; |
import org.hibernate.jdbc.Work; |
||||||
import org.hibernate.query.Query; |
import org.hibernate.query.Query; |
||||||
import org.junit.Test; |
import org.junit.Test; |
||||||
|
|
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEvent; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEventBuilder; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubEventBuilder; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubeventHasPerson; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.ClubeventHasPerson; |
||||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||||
|
|
||||||
public class ClubEventDataTest extends AbstractDatabaseTest { |
public class ClubEventDataTest extends AbstractDatabaseTest { |
||||||
|
|
||||||
public Person testInsertPerson() { |
public Person testInsertPerson() { |
||||||
Person p = new Person(); |
Person p = new Person(); |
||||||
p.setPrename("prename"); |
p.setPrename("prename"); |
||||||
p.setSurname("surname"); |
p.setSurname("surname"); |
||||||
p.setBirth(new Date()); |
p.setBirth(new Date()); |
||||||
Transaction tx = session.beginTransaction(); |
Transaction tx = session.beginTransaction(); |
||||||
session.save(p); |
session.save(p); |
||||||
tx.commit(); |
tx.commit(); |
||||||
return p; |
return p; |
||||||
} |
} |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void testInsertEvent() { |
public void testInsertEvent() { |
||||||
ClubEvent ev = creteEvent(); |
ClubEvent ev = creteEvent(); |
||||||
|
|
||||||
Transaction tx = session.beginTransaction(); |
Transaction tx = session.beginTransaction(); |
||||||
session.save(ev); |
session.save(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
} |
} |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void testSelectEvents() { |
public void testSelectEvents() { |
||||||
ClubEvent ev = creteEvent(); |
ClubEvent ev = creteEvent(); |
||||||
|
|
||||||
Transaction tx = session.beginTransaction(); |
Transaction tx = session.beginTransaction(); |
||||||
session.save(ev); |
session.save(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
|
|
||||||
Query<ClubEvent> query = session.createNamedQuery("ClubEvent.findAll", |
Query<ClubEvent> query = session.createNamedQuery("ClubEvent.findAll", |
||||||
ClubEvent.class); |
ClubEvent.class); |
||||||
List<ClubEvent> result = query.list(); |
List<ClubEvent> result = query.list(); |
||||||
assertEquals(1, result.size()); |
assertEquals(1, result.size()); |
||||||
} |
} |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void testEventWithPerson() { |
public void testEventWithPerson() { |
||||||
|
|
||||||
ClubEvent ev = creteEvent(); |
ClubEvent ev = creteEvent(); |
||||||
|
|
||||||
Person person = testInsertPerson(); |
Person person = testInsertPerson(); |
||||||
Set<Person> persons = ev.getPersons(); |
Set<Person> persons = ev.getPersons(); |
||||||
if (persons == null) { |
if (persons == null) { |
||||||
persons = new HashSet<>(); |
persons = new HashSet<>(); |
||||||
ev.setPersons(persons); |
ev.setPersons(persons); |
||||||
} |
} |
||||||
persons.add(person); |
persons.add(person); |
||||||
|
|
||||||
Transaction tx = session.beginTransaction(); |
Transaction tx = session.beginTransaction(); |
||||||
session.save(ev); |
session.save(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
|
|
||||||
List<ClubeventHasPerson> loadEventPersons = loadEventPersons(); |
List<ClubeventHasPerson> loadEventPersons = loadEventPersons(); |
||||||
assertFalse(loadEventPersons.isEmpty()); |
assertFalse(loadEventPersons.isEmpty()); |
||||||
ClubeventHasPerson link = loadEventPersons.get(0); |
ClubeventHasPerson link = loadEventPersons.get(0); |
||||||
assertEquals(person.getId(), link.getPersonId()); |
assertEquals(person.getId(), link.getPersonId()); |
||||||
assertEquals(ev.getId(), link.getClubEventId()); |
assertEquals(ev.getId(), link.getClubEventId()); |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
private List<ClubeventHasPerson> loadEventPersons() { |
private List<ClubeventHasPerson> loadEventPersons() { |
||||||
final AtomicBoolean finishedWork = new AtomicBoolean(false); |
final AtomicBoolean finishedWork = new AtomicBoolean(false); |
||||||
List<ClubeventHasPerson> link = new ArrayList<>(); |
List<ClubeventHasPerson> link = new ArrayList<>(); |
||||||
|
|
||||||
session.doWork(new Work() { |
session.doWork(new Work() { |
||||||
|
|
||||||
@Override |
@Override |
||||||
public void execute(Connection connection) throws SQLException { |
public void execute(Connection connection) throws SQLException { |
||||||
Statement stm = connection.createStatement(); |
Statement stm = connection.createStatement(); |
||||||
ResultSet rs = stm.executeQuery("select * from clubevent_has_person"); |
ResultSet rs = stm.executeQuery("select * from clubevent_has_person"); |
||||||
while (rs.next()) { |
while (rs.next()) { |
||||||
ClubeventHasPerson ep = new ClubeventHasPerson(); |
ClubeventHasPerson ep = new ClubeventHasPerson(); |
||||||
|
|
||||||
ep.setClubEventId(rs.getString("clubevent_id")); |
ep.setClubEventId(rs.getString("clubevent_id")); |
||||||
ep.setPersonId(rs.getInt("person_id")); |
ep.setPersonId(rs.getInt("person_id")); |
||||||
link.add(ep); |
link.add(ep); |
||||||
} |
} |
||||||
|
|
||||||
finishedWork.set(true); |
finishedWork.set(true); |
||||||
} |
} |
||||||
}); |
}); |
||||||
assertTrue(finishedWork.get()); |
assertTrue(finishedWork.get()); |
||||||
return link; |
return link; |
||||||
} |
} |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void changeEventsPersons() { |
public void changeEventsPersons() { |
||||||
ClubEvent ev = creteEvent(); |
ClubEvent ev = creteEvent(); |
||||||
|
|
||||||
Transaction tx = session.beginTransaction(); |
Transaction tx = session.beginTransaction(); |
||||||
session.save(ev); |
session.save(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
|
|
||||||
Person person = testInsertPerson(); |
Person person = testInsertPerson(); |
||||||
|
|
||||||
Person person2 = new Person(); |
Person person2 = new Person(); |
||||||
person2.setId(person.getId() + 1); |
person2.setId(person.getId() + 1); |
||||||
person2.setPrename(person.getPrename() + "_2"); |
person2.setPrename(person.getPrename() + "_2"); |
||||||
person2.setSurname(person.getSurname() + "_2"); |
person2.setSurname(person.getSurname() + "_2"); |
||||||
person2.setBirth(new Date()); |
person2.setBirth(new Date()); |
||||||
|
|
||||||
tx = session.beginTransaction(); |
tx = session.beginTransaction(); |
||||||
session.save(person2); |
session.save(person2); |
||||||
tx.commit(); |
tx.commit(); |
||||||
|
|
||||||
IdentifierLoadAccess<ClubEvent> idLoadAccess = session.byId(ClubEvent.class); |
IdentifierLoadAccess<ClubEvent> idLoadAccess = session.byId(ClubEvent.class); |
||||||
ClubEvent loaded = idLoadAccess.load(ev.getId()); |
ClubEvent loaded = idLoadAccess.load(ev.getId()); |
||||||
assertNotNull(loaded); |
assertNotNull(loaded); |
||||||
if (loaded.getPersons() == null) { |
if (loaded.getPersons() == null) { |
||||||
loaded.setPersons(new HashSet<>()); |
loaded.setPersons(new HashSet<>()); |
||||||
} |
} |
||||||
|
|
||||||
loaded.getPersons().add(person); |
loaded.getPersons().add(person); |
||||||
tx = session.beginTransaction(); |
tx = session.beginTransaction(); |
||||||
session.update(ev); |
session.update(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
|
|
||||||
loaded.getPersons().add(person2); |
loaded.getPersons().add(person2); |
||||||
tx = session.beginTransaction(); |
tx = session.beginTransaction(); |
||||||
session.update(ev); |
session.update(ev); |
||||||
tx.commit(); |
tx.commit(); |
||||||
List<ClubeventHasPerson> entries = loadEventPersons(); |
List<ClubeventHasPerson> entries = loadEventPersons(); |
||||||
assertEquals(2, entries.size()); |
assertEquals(2, entries.size()); |
||||||
} |
} |
||||||
|
|
||||||
private ClubEvent creteEvent() { |
private ClubEvent creteEvent() { |
||||||
ClubEvent ev = ClubEventBuilder.builder().withId("id").withAllDay(true) |
ClubEvent ev = ClubEventBuilder.builder().withId("id").withAllDay(true) |
||||||
.withCaption("caption").withDescription("description") |
.withCaption("caption").withDescription("description") |
||||||
.withStart(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
.withStart(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
||||||
ZoneId.systemDefault())) |
ZoneId.systemDefault())) |
||||||
.withEnd(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
.withEnd(ZonedDateTime.of(2018, 8, 13, 0, 0, 0, 0, |
||||||
ZoneId.systemDefault())) |
ZoneId.systemDefault())) |
||||||
.withiCalUID("iCalUID") |
.withiCalUID("iCalUID") |
||||||
.withOrganizerDisplayName("organizerDisplayName").build(); |
.withOrganizerDisplayName("organizerDisplayName").build(); |
||||||
return ev; |
return ev; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue