finished events and teams

master
dizda13 2017-03-24 01:47:43 +01:00
parent 9f5170c515
commit c9a2fd793f
9 changed files with 210 additions and 15 deletions

View File

@ -0,0 +1,10 @@
package ba.steleks.repository;
import ba.steleks.repository.model.EventType;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* Created by admin on 24/03/2017.
*/
public interface EventTypeJpaRepository extends PagingAndSortingRepository<EventType, Long> {
}

View File

@ -19,7 +19,9 @@ public class Event {
private Timestamp dateTime; private Timestamp dateTime;
private int duration; private int duration;
private long createdById; private long createdById;
private String eventType; @ManyToOne
@JoinColumn
private EventType eventType;
@ManyToMany @ManyToMany
@JoinColumn @JoinColumn
@ -83,11 +85,11 @@ public class Event {
this.createdById = createdById; this.createdById = createdById;
} }
public String getEventType() { public EventType getEventType() {
return eventType; return eventType;
} }
public void setEventType(String eventType) { public void setEventType(EventType eventType) {
this.eventType = eventType; this.eventType = eventType;
} }

View File

@ -0,0 +1,46 @@
package ba.steleks.repository.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* Created by admin on 24/03/2017.
*/
@Entity
public class EventType {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String category;
private String eventDescription;
public EventType() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getEventDescription() {
return eventDescription;
}
public void setEventDescription(String eventDescription) {
this.eventDescription = eventDescription;
}
}

View File

@ -0,0 +1,11 @@
package ba.steleks.repository;
import ba.steleks.repository.module.Participant;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* Created by admin on 24/03/2017.
*/
public interface ParticipantJpaRepository extends PagingAndSortingRepository<Participant, Long> {
}

View File

@ -0,0 +1,10 @@
package ba.steleks.repository;
import ba.steleks.repository.module.TeamCategory;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
* Created by admin on 24/03/2017.
*/
public interface TeamCategoryJpaRepository extends PagingAndSortingRepository<TeamCategory, Long> {
}

View File

@ -0,0 +1,66 @@
package ba.steleks.repository.module;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
/**
* Created by admin on 24/03/2017.
*/
@Entity
public class Participant {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String firstName;
private String lastName;
private String email;
private String profilePicture;
public Participant() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getProfilePicture() {
return profilePicture;
}
public void setProfilePicture(String profilePicture) {
this.profilePicture = profilePicture;
}
}

View File

@ -1,10 +1,8 @@
package ba.steleks.repository.module; package ba.steleks.repository.module;
import javax.persistence.Entity; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.security.auth.Subject; import javax.security.auth.Subject;
import java.util.Set;
/** /**
* Created by admin on 23/03/2017. * Created by admin on 23/03/2017.
@ -19,9 +17,21 @@ public class Team {
private long subjectId; private long subjectId;
private int position; private int position;
private double gradesOrPoints; private double gradesOrPoints;
private long contentId;
@ManyToOne
@JoinColumn
private TeamCategory teamCategory;
private long eventId; private long eventId;
@ManyToMany
@JoinColumn
private Set<Participant> participantSet;
@ManyToMany
@JoinColumn
private Set<TeamMedia> teamMediaSet;
protected Team() { protected Team() {
} }
@ -57,12 +67,12 @@ public class Team {
this.gradesOrPoints = gradesOrPoints; this.gradesOrPoints = gradesOrPoints;
} }
public long getContentId() { public TeamCategory getContentId() {
return contentId; return teamCategory;
} }
public void setContentId(long contentId) { public void setContentId(TeamCategory contentId) {
this.contentId = contentId; this.teamCategory = contentId;
} }
public long getEventId() { public long getEventId() {
@ -73,5 +83,11 @@ public class Team {
this.eventId = eventId; this.eventId = eventId;
} }
public Set<Participant> getParticipantSet() {
return participantSet;
}
public void setParticipantSet(Set<Participant> participantSet) {
this.participantSet = participantSet;
}
} }

View File

@ -0,0 +1,37 @@
package ba.steleks.repository.module;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* Created by admin on 24/03/2017.
*/
@Entity
public class TeamCategory {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String type;
public TeamCategory() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -13,9 +13,6 @@ public class TeamMedia {
private long id; private long id;
private String contentUrl; private String contentUrl;
@ManyToMany
@JoinColumn
private Set<TeamMedia> teamMediaSet;
protected TeamMedia() { protected TeamMedia() {