This repository has been archived on 2022-07-05. You can view files and clone it, but cannot push or open issues/pull-requests.
steleks_backend/events/src/main/java/ba/steleks/model/Event.java

115 lines
2.3 KiB
Java
Raw Normal View History

2017-04-02 17:58:09 +00:00
package ba.steleks.model;
2017-03-22 21:52:00 +00:00
import com.sun.istack.internal.Nullable;
2017-03-23 21:25:18 +00:00
import javax.persistence.*;
2017-03-22 21:52:00 +00:00
import java.sql.Timestamp;
2017-03-23 21:25:18 +00:00
import java.util.Set;
2017-03-22 21:52:00 +00:00
/**
* Created by admin on 22/03/2017.
*/
@Entity
public class Event {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String title;
2018-10-02 19:14:05 +00:00
@Column(columnDefinition="text")
2017-03-22 21:52:00 +00:00
private String shortText;
2018-10-02 19:14:05 +00:00
@Column(columnDefinition="text")
2017-03-22 21:52:00 +00:00
private String longText;
private Timestamp dateTime;
private int duration;
@Nullable
2017-03-23 21:25:18 +00:00
private long createdById;
2017-03-24 00:47:43 +00:00
@ManyToOne
@JoinColumn
private EventType eventType;
2017-03-22 21:52:00 +00:00
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(
name = "event_media_set",
2018-09-12 22:15:59 +00:00
joinColumns=@JoinColumn(name = "event_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name="media_set_id", referencedColumnName = "id")
)
2017-03-23 21:25:18 +00:00
private Set<Media> mediaSet;
2018-09-12 22:15:59 +00:00
public Event() {}
2017-03-23 02:50:16 +00:00
2017-03-22 21:52:00 +00:00
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getShortText() {
return shortText;
}
public void setShortText(String shortText) {
this.shortText = shortText;
}
public String getLongText() {
return longText;
}
public void setLongText(String longText) {
this.longText = longText;
}
public Timestamp getDateTime() {
return dateTime;
}
public void setDateTime(Timestamp dateTime) {
this.dateTime = dateTime;
}
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
2017-03-23 21:25:18 +00:00
public long getCreatedById() {
2017-03-22 21:52:00 +00:00
return createdById;
}
2017-03-23 21:25:18 +00:00
public void setCreatedById(long createdById) {
2017-03-22 21:52:00 +00:00
this.createdById = createdById;
}
2017-03-24 00:47:43 +00:00
public EventType getEventType() {
2017-03-22 21:52:00 +00:00
return eventType;
}
2017-03-24 00:47:43 +00:00
public void setEventType(EventType eventType) {
2017-03-22 21:52:00 +00:00
this.eventType = eventType;
}
2017-03-23 21:57:37 +00:00
public Set<Media> getMediaSet() {
return mediaSet;
}
public void setMediaSet(Set<Media> mediaSet) {
this.mediaSet = mediaSet;
}
2017-03-22 21:52:00 +00:00
}