Package ch.interlis.ili2c.metamodel

Examples of ch.interlis.ili2c.metamodel.Model


        Iterator modeli = td.iterator();
        while (modeli.hasNext()) {
            Object mObj = modeli.next();

            if (mObj instanceof Model) {
                Model model = (Model) mObj;
                if (model instanceof TypeModel) {
                    continue;
                }
                if (model instanceof PredefinedModel) {
                    continue;
                }
                Iterator topici = model.iterator();
                while (topici.hasNext()) {
                    Object tObj = topici.next();

                    if (tObj instanceof Topic) {
                        Topic topic = (Topic) tObj;
View Full Code Here


        Iterator modeli = iliTd.iterator();
        while (modeli.hasNext()) {
            Object mObj = modeli.next();

            if (mObj instanceof Model) {
                Model model = (Model) mObj;

                if (model instanceof TypeModel) {
                    continue;
                }

                if (model instanceof PredefinedModel) {
                    continue;
                }
                Iterator topici = model.iterator();

                while (topici.hasNext()) {
                    Object tObj = topici.next();

                    if (tObj instanceof Topic) {
View Full Code Here

        Iterator modeli = td.iterator();
        while (modeli.hasNext()) {
            Object mObj = modeli.next();
            if (mObj instanceof Model) {
                Model model = (Model) mObj;
                if (model instanceof TypeModel) {
                    continue;
                }
                if (model instanceof PredefinedModel) {
                    Iterator topici = model.iterator();
                    while (topici.hasNext()) {
                        Object tObj = topici.next();
                        if (tObj instanceof Domain) {
                            Type domainType = ((Domain) tObj).getType();
                            if (domainType instanceof EnumerationType) {
                                EnumerationType enumerationType = (EnumerationType) domainType;
                                ch.interlis.ili2c.metamodel.Enumeration enumerations = (ch.interlis.ili2c.metamodel.Enumeration) enumerationType
                                        .getConsolidatedEnumeration();

                                String enumName = "enum__"
                                        + model.getName().toLowerCase()
                                        + "_"
                                        + ((Domain) tObj).getName()
                                                .toLowerCase();

                                enums.append("\n");
                                enums.append("CREATE TABLE " + schema + "."
                                        + enumName);
                                enums.append("\n");
                                enums.append("(");
                                enums.append("\n ");
                                enums.append("ogc_fid SERIAL PRIMARY KEY, \n ");
                                enums.append("code INTEGER, \n ");
                                enums.append("code_txt VARCHAR \n ");
                                enums.append(")\n");
                                enums.append("WITH (OIDS=FALSE);\n");
                                enums.append("ALTER TABLE " + schema + "."
                                        + enumName + " OWNER TO " + grantUser
                                        + ";\n");
                                enums.append("GRANT ALL ON " + schema + "."
                                        + enumName + " TO " + grantUser + ";\n");
                                enums.append("GRANT SELECT ON " + schema + "."
                                        + enumName + " TO " + selectUser
                                        + ";\n\n");

                                ArrayList ev = new ArrayList();
                                ch.interlis.iom_j.itf.ModelUtilities
                                        .buildEnumList(
                                                ev,
                                                "",
                                                ((EnumerationType) domainType)
                                                        .getConsolidatedEnumeration());

                                for (int i = 0; i < ev.size(); i++) {
                                    String sql = "INSERT INTO " + schema + "."
                                            + enumName
                                            + "(code, code_txt) VALUES (" + i
                                            + ", '" + ev.get(i) + "');\n";
                                    enums.append(sql);
                                }
                            }
                        }
                    }
                    continue;
                }
                Iterator topici = model.iterator();
                while (topici.hasNext()) {
                    Object tObj = topici.next();
                    if (tObj instanceof Domain) {
                        Type domainType = ((Domain) tObj).getType();
                        if (domainType instanceof EnumerationType) {
                            EnumerationType enumerationType = (EnumerationType) domainType;
                            ch.interlis.ili2c.metamodel.Enumeration enumerations = (ch.interlis.ili2c.metamodel.Enumeration) enumerationType
                                    .getConsolidatedEnumeration();

                            String enumName = "enum__"
                                    + model.getName().toLowerCase() + "_"
                                    + ((Domain) tObj).getName().toLowerCase();

                            enums.append("\n");
                            enums.append("CREATE TABLE " + schema + "."
                                    + enumName);
View Full Code Here

TOP

Related Classes of ch.interlis.ili2c.metamodel.Model

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.