parent
00d795fe07
commit
192a9668d0
@ -0,0 +1,16 @@ |
||||
<?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-unit name="vaadin-clubhelper"> |
||||
<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.Contact</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.Person</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.Startpaesse</class> |
||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.StartpassStartrechte</class> |
||||
<class>de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Version</class> |
||||
</persistence-unit> |
||||
</persistence> |
||||
@ -0,0 +1,12 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
||||
@SpringBootApplication |
||||
public class VaadinClubhelperApplication { |
||||
|
||||
public static void main(String[] args) { |
||||
SpringApplication.run(VaadinClubhelperApplication.class, args); |
||||
} |
||||
} |
||||
@ -0,0 +1,9 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface IDao<T> { |
||||
|
||||
void save(T obj); |
||||
List<T> list(); |
||||
} |
||||
@ -0,0 +1,7 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
||||
|
||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||
|
||||
public interface PersonDao extends IDao<Person> { |
||||
|
||||
} |
||||
@ -0,0 +1,31 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
||||
|
||||
import java.util.List; |
||||
|
||||
import javax.persistence.EntityManager; |
||||
import javax.persistence.TypedQuery; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||
|
||||
@Repository |
||||
public class PersonDaoImpl implements PersonDao { |
||||
|
||||
@Autowired |
||||
EntityManager em; |
||||
|
||||
@Override |
||||
public void save(Person obj) { |
||||
em.persist(obj); |
||||
} |
||||
|
||||
@Override |
||||
public List<Person> list() { |
||||
TypedQuery<Person> query = em.createNamedQuery(Person.QUERY_FINDALL, |
||||
Person.class); |
||||
return query.getResultList(); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,5 @@ |
||||
/** |
||||
* @author markus |
||||
* |
||||
*/ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.dao; |
||||
@ -0,0 +1,118 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the adress database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="adress") |
||||
@NamedQuery(name="Adress.findAll", query="SELECT a FROM Adress a") |
||||
public class Adress implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
private String adress1; |
||||
|
||||
private String adress2; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
private String city; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private String plz; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
private Person person; |
||||
|
||||
public Adress() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getAdress1() { |
||||
return this.adress1; |
||||
} |
||||
|
||||
public void setAdress1(String adress1) { |
||||
this.adress1 = adress1; |
||||
} |
||||
|
||||
public String getAdress2() { |
||||
return this.adress2; |
||||
} |
||||
|
||||
public void setAdress2(String adress2) { |
||||
this.adress2 = adress2; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public String getCity() { |
||||
return this.city; |
||||
} |
||||
|
||||
public void setCity(String city) { |
||||
this.city = city; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getPlz() { |
||||
return this.plz; |
||||
} |
||||
|
||||
public void setPlz(String plz) { |
||||
this.plz = plz; |
||||
} |
||||
|
||||
public Person getPerson() { |
||||
return this.person; |
||||
} |
||||
|
||||
public void setPerson(Person person) { |
||||
this.person = person; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,90 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the attendance database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="attendance") |
||||
@NamedQuery(name="Attendance.findAll", query="SELECT a FROM Attendance a") |
||||
public class Attendance implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
@Column(name="on_date") |
||||
private Date onDate; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
private Person person; |
||||
|
||||
public Attendance() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public Date getOnDate() { |
||||
return this.onDate; |
||||
} |
||||
|
||||
public void setOnDate(Date onDate) { |
||||
this.onDate = onDate; |
||||
} |
||||
|
||||
public Person getPerson() { |
||||
return this.person; |
||||
} |
||||
|
||||
public void setPerson(Person person) { |
||||
this.person = person; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,98 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the contact database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="contact") |
||||
@NamedQuery(name="Contact.findAll", query="SELECT c FROM Contact c") |
||||
public class Contact implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private String type; |
||||
|
||||
private String value; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
private Person person; |
||||
|
||||
public Contact() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getType() { |
||||
return this.type; |
||||
} |
||||
|
||||
public void setType(String type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return this.value; |
||||
} |
||||
|
||||
public void setValue(String value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
public Person getPerson() { |
||||
return this.person; |
||||
} |
||||
|
||||
public void setPerson(Person person) { |
||||
this.person = person; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,86 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the deleted_entries database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="deleted_entries") |
||||
@NamedQuery(name="DeletedEntry.findAll", query="SELECT d FROM DeletedEntry d") |
||||
public class DeletedEntry implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private int entryId; |
||||
|
||||
private String tablename; |
||||
|
||||
public DeletedEntry() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public int getEntryId() { |
||||
return this.entryId; |
||||
} |
||||
|
||||
public void setEntryId(int entryId) { |
||||
this.entryId = entryId; |
||||
} |
||||
|
||||
public String getTablename() { |
||||
return this.tablename; |
||||
} |
||||
|
||||
public void setTablename(String tablename) { |
||||
this.tablename = tablename; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,103 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the groupDef database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="groupDef") |
||||
@NamedQuery(name="GroupDef.findAll", query="SELECT g FROM GroupDef g") |
||||
public class GroupDef implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private String name; |
||||
|
||||
//bi-directional many-to-one association to Persongroup
|
||||
@OneToMany(mappedBy="groupDef") |
||||
private List<Persongroup> persongroups; |
||||
|
||||
public GroupDef() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getName() { |
||||
return this.name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public List<Persongroup> getPersongroups() { |
||||
return this.persongroups; |
||||
} |
||||
|
||||
public void setPersongroups(List<Persongroup> persongroups) { |
||||
this.persongroups = persongroups; |
||||
} |
||||
|
||||
public Persongroup addPersongroup(Persongroup persongroup) { |
||||
getPersongroups().add(persongroup); |
||||
persongroup.setGroupDef(this); |
||||
|
||||
return persongroup; |
||||
} |
||||
|
||||
public Persongroup removePersongroup(Persongroup persongroup) { |
||||
getPersongroups().remove(persongroup); |
||||
persongroup.setGroupDef(null); |
||||
|
||||
return persongroup; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,311 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
import javax.persistence.Entity; |
||||
import javax.persistence.GeneratedValue; |
||||
import javax.persistence.GenerationType; |
||||
import javax.persistence.Id; |
||||
import javax.persistence.NamedQuery; |
||||
import javax.persistence.OneToMany; |
||||
import javax.persistence.Table; |
||||
import javax.persistence.Temporal; |
||||
import javax.persistence.TemporalType; |
||||
|
||||
/** |
||||
* The persistent class for the person database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name = "person") |
||||
@NamedQuery(name = Person.QUERY_FINDALL, query = "SELECT p FROM Person p") |
||||
public class Person implements Serializable { |
||||
|
||||
public final static String QUERY_FINDALL = "Person.findAll"; |
||||
|
||||
private static final long serialVersionUID = -8361264400619997123L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date birth; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private String password; |
||||
|
||||
private String prename; |
||||
|
||||
private String surname; |
||||
|
||||
private String username; |
||||
|
||||
// bi-directional many-to-one association to Adress
|
||||
@OneToMany(mappedBy = "person") |
||||
private List<Adress> adresses; |
||||
|
||||
// bi-directional many-to-one association to Attendance
|
||||
@OneToMany(mappedBy = "person") |
||||
private List<Attendance> attendances; |
||||
|
||||
// bi-directional many-to-one association to Contact
|
||||
@OneToMany(mappedBy = "person") |
||||
private List<Contact> contacts; |
||||
|
||||
// bi-directional many-to-one association to Persongroup
|
||||
@OneToMany(mappedBy = "person") |
||||
private List<Persongroup> persongroups; |
||||
|
||||
// bi-directional many-to-one association to Relative
|
||||
@OneToMany(mappedBy = "person1Bean") |
||||
private List<Relative> relatives1; |
||||
|
||||
// bi-directional many-to-one association to Relative
|
||||
@OneToMany(mappedBy = "person2Bean") |
||||
private List<Relative> relatives2; |
||||
|
||||
// bi-directional many-to-one association to Startpaesse
|
||||
@OneToMany(mappedBy = "person") |
||||
private List<Startpaesse> startpaesses; |
||||
|
||||
public Person() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getBirth() { |
||||
return this.birth; |
||||
} |
||||
|
||||
public void setBirth(Date birth) { |
||||
this.birth = birth; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getPassword() { |
||||
return this.password; |
||||
} |
||||
|
||||
public void setPassword(String password) { |
||||
this.password = password; |
||||
} |
||||
|
||||
public String getPrename() { |
||||
return this.prename; |
||||
} |
||||
|
||||
public void setPrename(String prename) { |
||||
this.prename = prename; |
||||
} |
||||
|
||||
public String getSurname() { |
||||
return this.surname; |
||||
} |
||||
|
||||
public void setSurname(String surname) { |
||||
this.surname = surname; |
||||
} |
||||
|
||||
public String getUsername() { |
||||
return this.username; |
||||
} |
||||
|
||||
public void setUsername(String username) { |
||||
this.username = username; |
||||
} |
||||
|
||||
public List<Adress> getAdresses() { |
||||
return this.adresses; |
||||
} |
||||
|
||||
public void setAdresses(List<Adress> adresses) { |
||||
this.adresses = adresses; |
||||
} |
||||
|
||||
public Adress addAdress(Adress adress) { |
||||
getAdresses().add(adress); |
||||
adress.setPerson(this); |
||||
|
||||
return adress; |
||||
} |
||||
|
||||
public Adress removeAdress(Adress adress) { |
||||
getAdresses().remove(adress); |
||||
adress.setPerson(null); |
||||
|
||||
return adress; |
||||
} |
||||
|
||||
public List<Attendance> getAttendances() { |
||||
return this.attendances; |
||||
} |
||||
|
||||
public void setAttendances(List<Attendance> attendances) { |
||||
this.attendances = attendances; |
||||
} |
||||
|
||||
public Attendance addAttendance(Attendance attendance) { |
||||
getAttendances().add(attendance); |
||||
attendance.setPerson(this); |
||||
|
||||
return attendance; |
||||
} |
||||
|
||||
public Attendance removeAttendance(Attendance attendance) { |
||||
getAttendances().remove(attendance); |
||||
attendance.setPerson(null); |
||||
|
||||
return attendance; |
||||
} |
||||
|
||||
public List<Contact> getContacts() { |
||||
return this.contacts; |
||||
} |
||||
|
||||
public void setContacts(List<Contact> contacts) { |
||||
this.contacts = contacts; |
||||
} |
||||
|
||||
public Contact addContact(Contact contact) { |
||||
getContacts().add(contact); |
||||
contact.setPerson(this); |
||||
|
||||
return contact; |
||||
} |
||||
|
||||
public Contact removeContact(Contact contact) { |
||||
getContacts().remove(contact); |
||||
contact.setPerson(null); |
||||
|
||||
return contact; |
||||
} |
||||
|
||||
public List<Persongroup> getPersongroups() { |
||||
return this.persongroups; |
||||
} |
||||
|
||||
public void setPersongroups(List<Persongroup> persongroups) { |
||||
this.persongroups = persongroups; |
||||
} |
||||
|
||||
public Persongroup addPersongroup(Persongroup persongroup) { |
||||
getPersongroups().add(persongroup); |
||||
persongroup.setPerson(this); |
||||
|
||||
return persongroup; |
||||
} |
||||
|
||||
public Persongroup removePersongroup(Persongroup persongroup) { |
||||
getPersongroups().remove(persongroup); |
||||
persongroup.setPerson(null); |
||||
|
||||
return persongroup; |
||||
} |
||||
|
||||
public List<Relative> getRelatives1() { |
||||
return this.relatives1; |
||||
} |
||||
|
||||
public void setRelatives1(List<Relative> relatives1) { |
||||
this.relatives1 = relatives1; |
||||
} |
||||
|
||||
public Relative addRelatives1(Relative relatives1) { |
||||
getRelatives1().add(relatives1); |
||||
relatives1.setPerson1Bean(this); |
||||
|
||||
return relatives1; |
||||
} |
||||
|
||||
public Relative removeRelatives1(Relative relatives1) { |
||||
getRelatives1().remove(relatives1); |
||||
relatives1.setPerson1Bean(null); |
||||
|
||||
return relatives1; |
||||
} |
||||
|
||||
public List<Relative> getRelatives2() { |
||||
return this.relatives2; |
||||
} |
||||
|
||||
public void setRelatives2(List<Relative> relatives2) { |
||||
this.relatives2 = relatives2; |
||||
} |
||||
|
||||
public Relative addRelatives2(Relative relatives2) { |
||||
getRelatives2().add(relatives2); |
||||
relatives2.setPerson2Bean(this); |
||||
|
||||
return relatives2; |
||||
} |
||||
|
||||
public Relative removeRelatives2(Relative relatives2) { |
||||
getRelatives2().remove(relatives2); |
||||
relatives2.setPerson2Bean(null); |
||||
|
||||
return relatives2; |
||||
} |
||||
|
||||
public List<Startpaesse> getStartpaesses() { |
||||
return this.startpaesses; |
||||
} |
||||
|
||||
public void setStartpaesses(List<Startpaesse> startpaesses) { |
||||
this.startpaesses = startpaesses; |
||||
} |
||||
|
||||
public Startpaesse addStartpaess(Startpaesse startpaess) { |
||||
getStartpaesses().add(startpaess); |
||||
startpaess.setPerson(this); |
||||
|
||||
return startpaess; |
||||
} |
||||
|
||||
public Startpaesse removeStartpaess(Startpaesse startpaess) { |
||||
getStartpaesses().remove(startpaess); |
||||
startpaess.setPerson(null); |
||||
|
||||
return startpaess; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,91 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the persongroup database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="persongroup") |
||||
@NamedQuery(name="Persongroup.findAll", query="SELECT p FROM Persongroup p") |
||||
public class Persongroup implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
private Person person; |
||||
|
||||
//bi-directional many-to-one association to GroupDef
|
||||
@ManyToOne |
||||
@JoinColumn(name="group_id") |
||||
private GroupDef groupDef; |
||||
|
||||
public Persongroup() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public Person getPerson() { |
||||
return this.person; |
||||
} |
||||
|
||||
public void setPerson(Person person) { |
||||
this.person = person; |
||||
} |
||||
|
||||
public GroupDef getGroupDef() { |
||||
return this.groupDef; |
||||
} |
||||
|
||||
public void setGroupDef(GroupDef groupDef) { |
||||
this.groupDef = groupDef; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,114 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the relative database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="relative") |
||||
@NamedQuery(name="Relative.findAll", query="SELECT r FROM Relative r") |
||||
public class Relative implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
@Column(name="TO_PERSON1_RELATION") |
||||
private String toPerson1Relation; |
||||
|
||||
@Column(name="TO_PERSON2_RELATION") |
||||
private String toPerson2Relation; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
@JoinColumn(name="person1") |
||||
private Person person1Bean; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
@JoinColumn(name="person2") |
||||
private Person person2Bean; |
||||
|
||||
public Relative() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getToPerson1Relation() { |
||||
return this.toPerson1Relation; |
||||
} |
||||
|
||||
public void setToPerson1Relation(String toPerson1Relation) { |
||||
this.toPerson1Relation = toPerson1Relation; |
||||
} |
||||
|
||||
public String getToPerson2Relation() { |
||||
return this.toPerson2Relation; |
||||
} |
||||
|
||||
public void setToPerson2Relation(String toPerson2Relation) { |
||||
this.toPerson2Relation = toPerson2Relation; |
||||
} |
||||
|
||||
public Person getPerson1Bean() { |
||||
return this.person1Bean; |
||||
} |
||||
|
||||
public void setPerson1Bean(Person person1Bean) { |
||||
this.person1Bean = person1Bean; |
||||
} |
||||
|
||||
public Person getPerson2Bean() { |
||||
return this.person2Bean; |
||||
} |
||||
|
||||
public void setPerson2Bean(Person person2Bean) { |
||||
this.person2Bean = person2Bean; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,116 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the startpaesse database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="startpaesse") |
||||
@NamedQuery(name="Startpaesse.findAll", query="SELECT s FROM Startpaesse s") |
||||
public class Startpaesse implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
@Column(name="startpass_nr") |
||||
private String startpassNr; |
||||
|
||||
//bi-directional many-to-one association to Person
|
||||
@ManyToOne |
||||
private Person person; |
||||
|
||||
//bi-directional many-to-one association to StartpassStartrechte
|
||||
@OneToMany(mappedBy="startpaesse") |
||||
private List<StartpassStartrechte> startpassStartrechtes; |
||||
|
||||
public Startpaesse() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getStartpassNr() { |
||||
return this.startpassNr; |
||||
} |
||||
|
||||
public void setStartpassNr(String startpassNr) { |
||||
this.startpassNr = startpassNr; |
||||
} |
||||
|
||||
public Person getPerson() { |
||||
return this.person; |
||||
} |
||||
|
||||
public void setPerson(Person person) { |
||||
this.person = person; |
||||
} |
||||
|
||||
public List<StartpassStartrechte> getStartpassStartrechtes() { |
||||
return this.startpassStartrechtes; |
||||
} |
||||
|
||||
public void setStartpassStartrechtes(List<StartpassStartrechte> startpassStartrechtes) { |
||||
this.startpassStartrechtes = startpassStartrechtes; |
||||
} |
||||
|
||||
public StartpassStartrechte addStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
||||
getStartpassStartrechtes().add(startpassStartrechte); |
||||
startpassStartrechte.setStartpaesse(this); |
||||
|
||||
return startpassStartrechte; |
||||
} |
||||
|
||||
public StartpassStartrechte removeStartpassStartrechte(StartpassStartrechte startpassStartrechte) { |
||||
getStartpassStartrechtes().remove(startpassStartrechte); |
||||
startpassStartrechte.setStartpaesse(null); |
||||
|
||||
return startpassStartrechte; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,124 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the startpass_startrechte database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="startpass_startrechte") |
||||
@NamedQuery(name="StartpassStartrechte.findAll", query="SELECT s FROM StartpassStartrechte s") |
||||
public class StartpassStartrechte implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date changed; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date created; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private String fachgebiet; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
@Column(name="startrecht_beginn") |
||||
private Date startrechtBeginn; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
@Column(name="startrecht_ende") |
||||
private Date startrechtEnde; |
||||
|
||||
@Column(name="verein_name") |
||||
private String vereinName; |
||||
|
||||
//bi-directional many-to-one association to Startpaesse
|
||||
@ManyToOne |
||||
@JoinColumn(name="startpass_id") |
||||
private Startpaesse startpaesse; |
||||
|
||||
public StartpassStartrechte() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getChanged() { |
||||
return this.changed; |
||||
} |
||||
|
||||
public void setChanged(Date changed) { |
||||
this.changed = changed; |
||||
} |
||||
|
||||
public Date getCreated() { |
||||
return this.created; |
||||
} |
||||
|
||||
public void setCreated(Date created) { |
||||
this.created = created; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public String getFachgebiet() { |
||||
return this.fachgebiet; |
||||
} |
||||
|
||||
public void setFachgebiet(String fachgebiet) { |
||||
this.fachgebiet = fachgebiet; |
||||
} |
||||
|
||||
public Date getStartrechtBeginn() { |
||||
return this.startrechtBeginn; |
||||
} |
||||
|
||||
public void setStartrechtBeginn(Date startrechtBeginn) { |
||||
this.startrechtBeginn = startrechtBeginn; |
||||
} |
||||
|
||||
public Date getStartrechtEnde() { |
||||
return this.startrechtEnde; |
||||
} |
||||
|
||||
public void setStartrechtEnde(Date startrechtEnde) { |
||||
this.startrechtEnde = startrechtEnde; |
||||
} |
||||
|
||||
public String getVereinName() { |
||||
return this.vereinName; |
||||
} |
||||
|
||||
public void setVereinName(String vereinName) { |
||||
this.vereinName = vereinName; |
||||
} |
||||
|
||||
public Startpaesse getStartpaesse() { |
||||
return this.startpaesse; |
||||
} |
||||
|
||||
public void setStartpaesse(Startpaesse startpaesse) { |
||||
this.startpaesse = startpaesse; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,54 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.data; |
||||
|
||||
import java.io.Serializable; |
||||
import javax.persistence.*; |
||||
import java.util.Date; |
||||
|
||||
|
||||
/** |
||||
* The persistent class for the version database table. |
||||
* |
||||
*/ |
||||
@Entity |
||||
@Table(name="version") |
||||
@NamedQuery(name="Version.findAll", query="SELECT v FROM Version v") |
||||
public class Version implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@Id |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
private int id; |
||||
|
||||
@Temporal(TemporalType.TIMESTAMP) |
||||
private Date deleted; |
||||
|
||||
private int version; |
||||
|
||||
public Version() { |
||||
} |
||||
|
||||
public int getId() { |
||||
return this.id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getDeleted() { |
||||
return this.deleted; |
||||
} |
||||
|
||||
public void setDeleted(Date deleted) { |
||||
this.deleted = deleted; |
||||
} |
||||
|
||||
public int getVersion() { |
||||
return this.version; |
||||
} |
||||
|
||||
public void setVersion(int version) { |
||||
this.version = version; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,35 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
||||
import com.vaadin.server.VaadinRequest; |
||||
import com.vaadin.spring.annotation.SpringUI; |
||||
import com.vaadin.ui.Label; |
||||
import com.vaadin.ui.UI; |
||||
import com.vaadin.ui.VerticalLayout; |
||||
|
||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||
|
||||
@SpringUI |
||||
public class MainUi extends UI { |
||||
|
||||
private static final long serialVersionUID = 7581634188909841919L; |
||||
@Autowired |
||||
PersonDao dao; |
||||
|
||||
@Override |
||||
protected void init(VaadinRequest request) { |
||||
VerticalLayout layout = new VerticalLayout(); |
||||
layout.addComponent(new Label("Persons found:")); |
||||
List<Person> persons = dao.list(); |
||||
for (Person p : persons) { |
||||
layout.addComponent( |
||||
new Label(p.getPrename() + " " + p.getSurname())); |
||||
} |
||||
setContent(layout); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper.ui.components; |
||||
|
||||
import java.text.DateFormat; |
||||
|
||||
import com.vaadin.ui.Grid; |
||||
|
||||
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||
|
||||
public class PersonGrid extends Grid<Person> { |
||||
|
||||
private static final long serialVersionUID = -8148097982839343673L; |
||||
private final DateFormat birthFormat = DateFormat |
||||
.getDateInstance(DateFormat.MEDIUM); |
||||
|
||||
public PersonGrid() { |
||||
addColumn(Person::getPrename); |
||||
addColumn(Person::getSurname); |
||||
addColumn(Person::getBirth, b -> birthFormat.format(b)); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,3 @@ |
||||
spring.datasource.url=jdbc:mysql://192.168.0.8:3306/clubhelper |
||||
spring.datasource.username=markus |
||||
spring.datasource.password=0773 |
||||
@ -0,0 +1,21 @@ |
||||
<?xml version='1.0' encoding='UTF-8'?> |
||||
<!DOCTYPE hibernate-configuration PUBLIC |
||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" |
||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> |
||||
|
||||
<hibernate-configuration> |
||||
<session-factory> |
||||
<!-- SQL Dialect --> |
||||
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> |
||||
|
||||
<!-- Database Connection Settings --> |
||||
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> |
||||
<property name="hibernate.connection.datasource">java:comp/env/jdbc/clubhelperbackend</property> |
||||
<property name="cache.providerclass">org.hibernate.NoCacheProvider</property> |
||||
<property name="show_sql">true</property> |
||||
|
||||
<!-- Specifying Session Context --> |
||||
<property name="hibernate.current_session_context_class">org.hibernate.context.internal.ThreadLocalSessionContext</property> |
||||
|
||||
</session-factory> |
||||
</hibernate-configuration> |
||||
@ -0,0 +1,16 @@ |
||||
package de.kreth.vaadin.clubhelper.vaadinclubhelper; |
||||
|
||||
import org.junit.Test; |
||||
import org.junit.runner.RunWith; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
import org.springframework.test.context.junit4.SpringRunner; |
||||
|
||||
@RunWith(SpringRunner.class) |
||||
@SpringBootTest |
||||
public class VaadinClubhelperApplicationTests { |
||||
|
||||
@Test |
||||
public void contextLoads() { |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue