Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table
- public class Question {
- @Id
- private Long id;
- @Column(nullable = true)
- private String text;
- @Column(nullable = true)
- private String title;
- }
- create table question (
- id number(19,0) not null,
- text varchar2(50 char) null,
- title varchar2(10,0) null,
- primary key (id)
- );
- @Entity
- @Table
- @Check(constraints = "TEXT IS NOT NULL OR TITLE IS NOT NULL")
- public class Question {
- ...
- }
- create table question (
- id number(19,0) not null,
- text varchar2(50 char) null,
- title varchar2(10,0) null,
- primary key (id),
- check (TEXT IS NOT NULL OR TITLE IS NOT NULL)
- );
- create table question (
- id number(19,0) not null,
- text varchar2(50 char) null,
- title varchar2(10,0) null,
- primary key (id),
- constraint check_title check(TEXT IS NOT NULL OR TITLE IS NOT NULL)
- );
- @Entity
- @Table
- @Check(name = "check_title" constraints = "TEXT IS NOT NULL OR TITLE IS NOT NULL")
- public class Question {
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement