131 lines
2.1 KiB
Java
131 lines
2.1 KiB
Java
/**
|
|
*
|
|
*/
|
|
package de.bstly.board.model;
|
|
|
|
import jakarta.persistence.Column;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.EntityListeners;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.GenerationType;
|
|
import jakarta.persistence.Id;
|
|
import jakarta.persistence.Table;
|
|
|
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|
|
|
import de.bstly.board.model.support.Types;
|
|
import de.bstly.board.model.support.VoteType;
|
|
|
|
/**
|
|
* The Class Vote.
|
|
*/
|
|
@Entity
|
|
@Table(name = "votes")
|
|
@EntityListeners({ AuditingEntityListener.class })
|
|
public class Vote {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
@Column(name = "id")
|
|
private Long id;
|
|
@Column(name = "target", nullable = false)
|
|
private Long target;
|
|
@Column(name = "target_type", nullable = false)
|
|
private Types targetType;
|
|
@Column(name = "author", nullable = false)
|
|
private String author;
|
|
@Column(name = "type", nullable = false)
|
|
private VoteType type;
|
|
|
|
/**
|
|
* 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 target.
|
|
*
|
|
* @return the target
|
|
*/
|
|
public Long getTarget() {
|
|
return target;
|
|
}
|
|
|
|
/**
|
|
* Sets the target.
|
|
*
|
|
* @param target the new target
|
|
*/
|
|
public void setTarget(Long target) {
|
|
this.target = target;
|
|
}
|
|
|
|
/**
|
|
* Gets the target type.
|
|
*
|
|
* @return the target type
|
|
*/
|
|
public Types getTargetType() {
|
|
return targetType;
|
|
}
|
|
|
|
/**
|
|
* Sets the target type.
|
|
*
|
|
* @param targetType the new target type
|
|
*/
|
|
public void setTargetType(Types targetType) {
|
|
this.targetType = targetType;
|
|
}
|
|
|
|
/**
|
|
* Gets the author.
|
|
*
|
|
* @return the author
|
|
*/
|
|
public String getAuthor() {
|
|
return author;
|
|
}
|
|
|
|
/**
|
|
* Sets the author.
|
|
*
|
|
* @param author the new author
|
|
*/
|
|
public void setAuthor(String author) {
|
|
this.author = author;
|
|
}
|
|
|
|
/**
|
|
* Gets the type.
|
|
*
|
|
* @return the type
|
|
*/
|
|
public VoteType getType() {
|
|
return type;
|
|
}
|
|
|
|
/**
|
|
* Sets the type.
|
|
*
|
|
* @param type the new type
|
|
*/
|
|
public void setType(VoteType type) {
|
|
this.type = type;
|
|
}
|
|
|
|
}
|