package com.hantsylabs.example.spring.model; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Version; import javax.validation.constraints.NotNull; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.springframework.format.annotation.DateTimeFormat; @Entity @Table(name="conference") public class Conference { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private Long id; @Version @Column(name = "version") private Integer version; @NotNull @Column(name = "name") private String name; @NotNull @Column(name = "description") private String description; @NotNull @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(style = "M-") @Column(name = "started_date") private Date startedDate; @NotNull @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(style = "M-") @Column(name = "ended_date") private Date endedDate; @NotNull @Column(name = "slug") private String slug; public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Date getStartedDate() { return this.startedDate; } public void setStartedDate(Date startedDate) { this.startedDate = startedDate; } public Date getEndedDate() { return this.endedDate; } public void setEndedDate(Date endedDate) { this.endedDate = endedDate; } public String getSlug() { return this.slug; } public void setSlug(String slug) { this.slug = slug; } @Override public String toString() { return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } public Integer getVersion() { return this.version; } public void setVersion(Integer version) { this.version = version; } }