Advertisement
Nonverbis

Untitled

Dec 3rd, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. package com.example.blog.site_options.entities;
  2.  
  3. import lombok.Getter;
  4.  
  5. import javax.persistence.*;
  6.  
  7. @Entity
  8. @Table(name="site_options__site_option",
  9. uniqueConstraints = {
  10. @UniqueConstraint(name = "theme_unique_constraint", columnNames= "theme"),
  11. })
  12. @Getter
  13. public class SiteOptionsEntity {
  14. @Id
  15. @GeneratedValue(strategy = GenerationType.IDENTITY)
  16. int id;
  17.  
  18. @Column(nullable = false)
  19. private String theme;
  20. }
  21.  
  22.  
  23.  
  24. Table "public.site_options__site_option"
  25. Column | Type | Collation | Nullable | Default
  26. --------+------------------------+-----------+----------+----------------------------------
  27. id | integer | | not null | generated by default as identity
  28. theme | character varying(255) | | not null |
  29. Indexes:
  30. "site_options__site_option_pkey" PRIMARY KEY, btree (id)
  31. "theme_unique_constraint" UNIQUE CONSTRAINT, btree (theme)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement