bstlboard-back/src/main/java/de/bstly/board/model/View.java

244 lines
4.3 KiB
Java

/**
*
*/
package de.bstly.board.model;
import java.util.List;
import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import de.bstly.board.model.support.EntryType;
import de.bstly.board.model.support.ViewSorting;
/**
* The Class View.
*/
@Entity
@Table(name = "views")
@EntityListeners({ AuditingEntityListener.class })
public class View {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", nullable = false)
private Long id;
@Column(name = "name", nullable = false)
private String name;
@Column(name = "username", nullable = false)
private String username;
@Enumerated(EnumType.STRING)
@Column(name = "sorting", nullable = false)
private ViewSorting sorting;
@Column(name = "indexNumber")
private int index = 99;
@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "views_tags")
private List<String> tags;
@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "views_excluded_tags")
private List<String> excludedTags;
@Column(name = "entry_type", nullable = true)
private EntryType entryType;
@Column(name = "public", columnDefinition = "boolean default false")
private boolean publicView;
@Column(name = "divider", columnDefinition = "boolean default false")
private boolean divider;
/**
* Gets the id.
*
* @return the id
*/
public Long getId() {
return id;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(Long id) {
this.id = id;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Sets the name.
*
* @param name the new name
*/
public void setName(String name) {
this.name = name;
}
/**
* Gets the username.
*
* @return the username
*/
public String getUsername() {
return username;
}
/**
* Sets the username.
*
* @param username the new username
*/
public void setUsername(String username) {
this.username = username;
}
/**
* Gets the sorting.
*
* @return the sorting
*/
public ViewSorting getSorting() {
return sorting;
}
/**
* Sets the sorting.
*
* @param sorting the new sorting
*/
public void setSorting(ViewSorting sorting) {
this.sorting = sorting;
}
/**
* Gets the index.
*
* @return the index
*/
public int getIndex() {
return index;
}
/**
* Sets the index.
*
* @param index the new index
*/
public void setIndex(int index) {
this.index = index;
}
/**
* Gets the tags.
*
* @return the tags
*/
public List<String> getTags() {
return tags;
}
/**
* Sets the tags.
*
* @param tags the new tags
*/
public void setTags(List<String> tags) {
this.tags = tags;
}
/**
* Gets the excluded tags.
*
* @return the excluded tags
*/
public List<String> getExcludedTags() {
return excludedTags;
}
/**
* Sets the excluded tags.
*
* @param excludedTags the new excluded tags
*/
public void setExcludedTags(List<String> excludedTags) {
this.excludedTags = excludedTags;
}
/**
* Gets the entry type.
*
* @return the entry type
*/
public EntryType getEntryType() {
return entryType;
}
/**
* Sets the entry type.
*
* @param entryType the new entry type
*/
public void setEntryType(EntryType entryType) {
this.entryType = entryType;
}
/**
* Checks if is public view.
*
* @return true, if is public view
*/
public boolean isPublicView() {
return publicView;
}
/**
* Sets the public view.
*
* @param publicView the new public view
*/
public void setPublicView(boolean publicView) {
this.publicView = publicView;
}
/**
* Checks if is divider.
*
* @return true, if is divider
*/
public boolean isDivider() {
return divider;
}
/**
* Sets the divider.
*
* @param divider the new divider
*/
public void setDivider(boolean divider) {
this.divider = divider;
}
}