Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.apidemo.model;
- import javax.persistence.*;
- import javax.validation.constraints.NotBlank;
- import javax.validation.constraints.Size;
- @Entity
- @Table(name = "questions")
- public class Question extends AuditModel {
- @Id
- @GeneratedValue(generator = "question_generator")
- @SequenceGenerator(
- name = "question_generator",
- sequenceName = "question_sequence",
- initialValue = 1000
- )
- private Long id;
- @NotBlank
- @Size(min=3, max=100)
- private String title;
- @Column(columnDefinition = "text")
- private String description;
- // Setter Getter
- 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 getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment