I have an attribute
private boolean include;
I would like to set its default value to true, so that in the database it must display True from d
Using JPA 2.1 and Oracle 11 this works for me by using Oracle type NUMBER of size 1:
Java:
@Column(name = "ENABLED", nullable = false)
private boolean enabled = true;
Create SQL script:
CREATE TABLE "ACCOUNT"(
"ID" NUMBER(10,0) NOT NULL ENABLE,
"NAME" VARCHAR2(255 CHAR) NOT NULL ENABLE,
"PASSWORD" VARCHAR2(255) NOT NULL ENABLE,
"ENABLED" NUMBER(1,0) DEFAULT 1 NOT NULL ENABLE,
PRIMARY KEY ("ID")
);