use of com.github.drinkjava2.jdialects.model.Table in project jDialects by drinkjava2.
the class TableTest method allowNullModel.
private static Table allowNullModel() {
// Allow Null
Table t = new Table("testTable");
t.column("b1").BOOLEAN();
t.column("d2").DOUBLE();
t.column("f3").FLOAT(5);
t.column("i4").INTEGER();
t.column("l5").LONG();
t.column("s6").SHORT();
t.column("b7").BIGDECIMAL(10, 2);
t.column("s8").STRING(20);
t.column("d9").DATE();
t.column("t10").TIME();
t.column("t11").TIMESTAMP();
t.column("v12").VARCHAR(300);
return t;
}
use of com.github.drinkjava2.jdialects.model.Table in project jDialects by drinkjava2.
the class TableTest method autoGeneratorModel2.
private static Table autoGeneratorModel2() {
// autoGenerator
Table t = new Table("testTable2");
t.addTableGenerator("tbgen7", "tb1", "pkcol4", "valcol", "pkval5", 1, 10);
t.column("i1").INTEGER().pkey().autoGenerator();
t.column("i2").INTEGER().autoGenerator();
t.column("i3").INTEGER().autoGenerator();
return t;
}
use of com.github.drinkjava2.jdialects.model.Table in project jDialects by drinkjava2.
the class TableTest method testNotNullModel.
private static Table testNotNullModel() {
// Not Null
Table t = new Table("testTable");
t.column("b1").BOOLEAN().notNull();
t.column("d2").DOUBLE().notNull();
t.column("f3").FLOAT(5).notNull();
t.column("i4").INTEGER().notNull();
t.column("l5").LONG().notNull();
t.column("s6").SHORT().notNull();
t.column("b7").BIGDECIMAL(10, 2).notNull();
t.column("s8").STRING(20).notNull();
t.column("d9").DATE().notNull();
t.column("t10").TIME().notNull();
t.column("t11").TIMESTAMP().notNull();
t.column("v12").VARCHAR(300).notNull();
return t;
}
use of com.github.drinkjava2.jdialects.model.Table in project jDialects by drinkjava2.
the class TableTest method tableCheckModel.
private static Table tableCheckModel() {
// table check
Table t = new Table("testTable");
t.check("s2>10");
t.column("s1").STRING(20).unique().notNull();
t.column("s2").STRING(20);
return t;
}
use of com.github.drinkjava2.jdialects.model.Table in project jDialects by drinkjava2.
the class TableTest method SequenceModel.
private static Table SequenceModel() {
// Sequence
Table t = new Table("testTable");
t.addSequence("seq1", "seq_1", 1, 1);
t.addSequence("seq2", "seq_2", 1, 1);
t.column("i1").INTEGER().pkey().sequence("seq1");
t.column("i2").INTEGER().pkey().sequence("seq2");
return t;
}
Aggregations