Package com.redspr.redquerybuilder.core.shared.meta

Examples of com.redspr.redquerybuilder.core.shared.meta.Database


        return createSession(null);
    }

    protected Session createSession(Configuration config) {
        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);

        Table person = new Table("PERSON"); // XXX want case sensitivity?
        Column personId = new Column("id", stringType);
        person.add(personId);
        person.add(new Column("sex", singleRefType));
View Full Code Here

TOP

Related Classes of com.redspr.redquerybuilder.core.shared.meta.Database

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.