Schema schema = new Schema();
Database database = new Database(schema);
Type stringType = new Type("VARCHAR");
stringType.setOperators(new Operator[] {
new Operator("="),
new Operator("IS NULL", Cardinality.ZERO),
new Operator("LIKE"), new Operator("CUSTOM_OP") });
// XXX IN done better as hint or style?
Type refType = new Type("REFS");
refType.setEditor(new Editor.SelectEditor());
refType.setOperators(new Operator[]{
new Operator("IN", Cardinality.MULTI),
new Operator("NOT IN", Cardinality.MULTI)});
Type suggestType = new Type("SUGGEST");
suggestType.setEditor(new SuggestEditor());
suggestType.setOperators(new Operator[]{new Operator("=")});
Type singleRefType = new Type("REF");
singleRefType.setEditor(new Editor.SelectEditor());
singleRefType.setOperators(new Operator[] {
new Operator("="),
new Operator("IS NULL", Cardinality.ZERO),
new Operator("CUSTOM_OP", Cardinality.ONE)});
Type dateType = new Type("DATE");
dateType.setEditor(new Editor.DateEditor());
Type[] types = new Type[]{stringType, dateType, refType, singleRefType};
database.setTypes(types);