package fi.otavanopisto.pyramus.domainmodel.courses;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TableGenerator;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.validator.constraints.NotEmpty;
import fi.otavanopisto.pyramus.domainmodel.base.ArchivableEntity;
@Entity
public class CourseType implements ArchivableEntity {
public Long getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setArchived(Boolean archived) {
this.archived = archived;
}
public Boolean getArchived() {
return archived;
}
@SuppressWarnings("unused")
private void setVersion(Long version) {
this.version = version;
}
public Long getVersion() {
return version;
}
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="CourseType")
@TableGenerator(name="CourseType", allocationSize=1, table = "hibernate_sequences", pkColumnName = "sequence_name", valueColumnName = "sequence_next_hi_value")
@DocumentId
private Long id;
@NotNull
@Column (nullable = false)
@NotEmpty
private String name;
@NotNull
@Column(nullable = false)
private Boolean archived;
@Version
@Column(nullable = false)
private Long version;
}