Guest User

Question.java

a guest
Feb 27th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. package com.example.apidemo.model;
  2.  
  3. import javax.persistence.*;
  4. import javax.validation.constraints.NotBlank;
  5. import javax.validation.constraints.Size;
  6.  
  7. @Entity
  8. @Table(name = "questions")
  9. public class Question extends AuditModel {
  10.    
  11.     @Id
  12.     @GeneratedValue(generator = "question_generator")
  13.     @SequenceGenerator(
  14.         name = "question_generator",
  15.         sequenceName = "question_sequence",
  16.         initialValue = 1000
  17.     )
  18.     private Long id;
  19.    
  20.     @NotBlank
  21.     @Size(min=3, max=100)
  22.     private String title;
  23.  
  24.     @Column(columnDefinition = "text")
  25.     private String description;
  26.    
  27.     // Setter Getter
  28.    
  29.     public Long getId() {
  30.         return id;
  31.     }
  32.  
  33.     public void setId(Long id) {
  34.         this.id = id;
  35.     }
  36.  
  37.     public String getTitle() {
  38.         return title;
  39.     }
  40.  
  41.     public void setTitle(String title) {
  42.         this.title = title;
  43.     }
  44.  
  45.     public String getDescription() {
  46.         return description;
  47.     }
  48.  
  49.     public void setDescription(String description) {
  50.         this.description = description;
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment