Examples of VendorExtension


Examples of xdoclet.modules.jdo.VendorExtension

        XDoc doc = getCurrentClass().getDoc();

        if (doc.hasTag(SQL_TABLE_TAG)) {
            String sqlName = doc.getTagAttributeValue(SQL_TABLE_TAG, TABLE_NAME_ATTR);

            extensions.add(new VendorExtension(getVendorName(), "sql-name", sqlName));
        }
        return extensions;
    }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

            if (STYLE_FOREIGN_KEY_VALUE.equals(style)) {
                if (doc.getTagAttributeValue("jdo.field", "collection-type") == null) {
                    Collection tags = doc.getTags(SQL_FIELD_TAG);
                    String sqlName = getSqlNames(tags.iterator());

                    extensions.add(new VendorExtension(getVendorName(), "sql-name", sqlName));
                }
                // else ignore
            }
            else if (STYLE_RELATION_TABLE_VALUE.equals(style)) {
                String tableName = doc.getTagAttributeValue(SQL_RELATION_TAG, TABLE_NAME_ATTR);

                extensions.add(new VendorExtension(getVendorName(), "sql-name", tableName));
            }
            else {
                LOG.warn(Translator.getString(XDocletModulesJdoMessages.class, XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                    new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
            }

        }
        else if (doc.hasTag(SQL_FIELD_TAG)) {
            // todo: check that the class is a primitive type or standard java-type
            //not sure I got the tag translations right...
            String tableName = doc.getTagAttributeValue(SQL_FIELD_TAG, TABLE_NAME_ATTR);
            String sqlName = doc.getTagAttributeValue(SQL_FIELD_TAG, COLUMN_NAME_ATTR);

            if (tableName != null &&
                !tableName.equals(doc.getTagAttributeValue(SQL_TABLE_TAG, TABLE_NAME_ATTR))) {
                LOG.warn(Translator.getString(XDocletModulesJdoMessages.class, XDocletModulesJdoMessages.NOT_SUPPORTED_MULTIPLE_TABLE_MAPPING,
                    new String[]{getVendorDescription()}));
            }
            extensions.add(new VendorExtension(getVendorName(), "sql-name", sqlName));
        }
        return extensions;
    }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

            String style = doc.getTagAttributeValue(SQL_RELATION_TAG, STYLE_ATTR);

            if (STYLE_FOREIGN_KEY_VALUE.equals(style)) {
                String relatedField = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);

                extensions.add(new VendorExtension(getVendorName(), "sql-reverse", "javaField:" + relatedField));
            }
            else if (STYLE_RELATION_TABLE_VALUE.equals(style)) {
                Collection tags = doc.getTags(SQL_FIELD_TAG);
                String sqlName = getSqlNames(tags.iterator());

                extensions.add(new VendorExtension(getVendorName(), "sql-owner-name", sqlName));

                String embeddedClassName = doc.getTagAttributeValue("jdo.field", "element-type");
                XClass embeddedClass = getXJavaDoc().getXClass(embeddedClassName);
                String relatedCollection = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);
                XDoc relatedDoc = embeddedClass.getField(relatedCollection).getDoc();
                Collection targetTags = relatedDoc.getTags(SQL_FIELD_TAG);
                String targetSqlName = getSqlNames(targetTags.iterator());

                extensions.add(new VendorExtension(getVendorName(), "sql-value-name", targetSqlName));
            }
            else {
                LOG.warn(Translator.getString(XDocletModulesJdoMessages.class, XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                    new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
            }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

            String collectionField = tag.getAttributeValue("collection-field");
            String mapField = tag.getAttributeValue("map-field");

            if (collectionField != null) {
                extensions.add(new VendorExtension(getVendorName(), "collection-field", collectionField));
            }
            if (mapField != null) {
                extensions.add(new VendorExtension(getVendorName(), "map-field", mapField));
            }
        }

        return extensions;
    }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

        if (doc.hasTag("tjdo.field")) {
            XTag tag = doc.getTag("tjdo.field");
            String ownerField = tag.getAttributeValue("owner-field");

            if (ownerField != null) {
                extensions.add(new VendorExtension(getVendorName(), "owner-field", ownerField));
            }
            addSizeExtensions(extensions, tag, "element-", "");
        }

        return extensions;
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

            XTag tag = doc.getTag("tjdo.field");
            String ownerField = tag.getAttributeValue("owner-field");
            String keyField = tag.getAttributeValue("key-field");

            if (ownerField != null) {
                extensions.add(new VendorExtension(getVendorName(), "owner-field", ownerField));
            }
            if (keyField != null) {
                extensions.add(new VendorExtension(getVendorName(), "key-field", keyField));
            }
            addSizeExtensions(extensions, tag, "key-", "key-");

            addSizeExtensions(extensions, tag, "value-", "value-");
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

        String length = tag.getAttributeValue(sourcePrefix + "length");
        String precision = tag.getAttributeValue(sourcePrefix + "precision");
        String scale = tag.getAttributeValue(sourcePrefix + "scale");

        if (length != null) {
            extensions.add(new VendorExtension(getVendorName(), targetPrefix + "length", length));
        }
        if (precision != null) {
            extensions.add(new VendorExtension(getVendorName(), targetPrefix + "precision", precision));
        }
        if (scale != null) {
            extensions.add(new VendorExtension(getVendorName(), targetPrefix + "scale", scale));
        }

    }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

        XDoc doc = getCurrentClass().getDoc();

        if (doc.hasTag(SQL_TABLE_TAG)) {
            String sqlName = doc.getTagAttributeValue(SQL_TABLE_TAG, TABLE_NAME_ATTR);

            extensions.add(new VendorExtension(getVendorName(), "table", sqlName));
            if (doc.hasTag("kodo.table")) {
                XTag tag = doc.getTag("kodo.table");
                String pkColumn = tag.getAttributeValue("pk-column");
                String lockColumn = tag.getAttributeValue("lock-column");
                String classColumn = tag.getAttributeValue("class-column");

                if (pkColumn != null) {
                    extensions.add(new VendorExtension(getVendorName(), "pk-column", pkColumn));

                    String identity = doc.getTagAttributeValue("jdo.persistence-capable", "identity-type");

                    if (identity == null || "datastore".equals(identity)) {
                        LOG.warn(Translator.getString(XDocletModulesSolarmetricMessages.class,
                            XDocletModulesSolarmetricMessages.NOT_SUPPORTED_PK_COLUMN_AND_DATASTORE_IDENTITY));
                    }
                }
                if (lockColumn != null) {
                    extensions.add(new VendorExtension(getVendorName(), "lock-column", lockColumn));
                }
                if (classColumn != null) {
                    extensions.add(new VendorExtension(getVendorName(), "class-column", classColumn));
                }
            }
        }
        return extensions;
    }
View Full Code Here

Examples of xdoclet.modules.jdo.VendorExtension

                    for (Iterator i = tags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-data-column", columnName));
                    }
                }
                else {
                    LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                        XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                        new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
                }
            }
            else if ("collection".equals(collectionType) || "array".equals(collectionType)) {
                String style = doc.getTagAttributeValue(SQL_RELATION_TAG, STYLE_ATTR);

                if (STYLE_FOREIGN_KEY_VALUE.equals(style)) {
                    String relatedField = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);

                    extensions.add(new VendorExtension(getVendorName(), "inverse", relatedField));
                }
                else if (STYLE_RELATION_TABLE_VALUE.equals(style)) {
                    String embeddedClassName = doc.getTagAttributeValue("jdo.field", "element-type");
                    XClass embeddedClass = getXJavaDoc().getXClass(embeddedClassName);
                    String relatedCollection = doc.getTagAttributeValue(SQL_RELATION_TAG, RELATED_FIELD_ATTR);
                    XDoc relatedDoc = embeddedClass.getField(relatedCollection).getDoc();

                    extensions.add(new VendorExtension(getVendorName(), "inverse", relatedCollection));

                    String relationTable = doc.getTagAttributeValue(SQL_RELATION_TAG, TABLE_NAME_ATTR);

                    extensions.add(new VendorExtension(getVendorName(), "table", relationTable));

                    Collection tags = doc.getTags(SQL_FIELD_TAG);

                    for (Iterator i = tags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-ref-column", columnName));
                    }

                    Collection targetTags = relatedDoc.getTags(SQL_FIELD_TAG);

                    for (Iterator i = targetTags.iterator(); i.hasNext(); ) {
                        XTag tag = (XTag)i.next();
                        String columnName = tag.getAttributeValue(COLUMN_NAME_ATTR);
                        String relatedField = tag.getAttributeValue(RELATED_FIELD_ATTR);

                        extensions.add(new VendorExtension(getVendorName(), relatedField + "-data-column", columnName));
                    }
                }
                else {
                    LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                        XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                        new String[]{SQL_RELATION_TAG, STYLE_ATTR, style, getVendorDescription()}));
                }
            }
            else {
                LOG.warn(Translator.getString(XDocletModulesJdoMessages.class,
                    XDocletModulesJdoMessages.NOT_SUPPORTED_TAG_ATTRIBUTE_VALUE,
                    new String[]{"jdo.field", "collection-type", collectionType, getVendorDescription()}));
            }

        }
        else if (doc.hasTag(SQL_FIELD_TAG)) {
            String tableName = doc.getTagAttributeValue(SQL_FIELD_TAG, TABLE_NAME_ATTR);
            String columnName = doc.getTagAttributeValue(SQL_FIELD_TAG, COLUMN_NAME_ATTR);

            if ("true".equals(doc.getTagAttributeValue("jdo.field", "primary-key"))) {
                XDoc classDoc = getCurrentClass().getDoc();
                String identity = classDoc.getTagAttributeValue("jdo.persistence-capable", "identity-type");

                if (identity == null || "datastore".equals(identity)) {
                    LOG.warn(Translator.getString(XDocletModulesSolarmetricMessages.class,
                        XDocletModulesSolarmetricMessages.NOT_SUPPORTED_PK_FIELD_AND_DATASTORE_IDENTITY));
                }
            }
            if (tableName != null) {
                extensions.add(new VendorExtension(getVendorName(), "table", tableName));
            }
            extensions.add(new VendorExtension(getVendorName(), "data-column", columnName));

            if (doc.hasTag("kodo.field")) {
                XTag tag = doc.getTag("kodo.field");
                String blob = tag.getAttributeValue("blob");
                String columnLength = tag.getAttributeValue("column-length");
                String columnIndex = tag.getAttributeValue("column-index");
                String ordered = tag.getAttributeValue("ordered");
                String orderColumn = tag.getAttributeValue("order-column");
                String readOnly = tag.getAttributeValue("read-only");

                if (blob != null) {
                    extensions.add(new VendorExtension(getVendorName(), "blob", blob));
                }
                if (columnLength != null) {
                    extensions.add(new VendorExtension(getVendorName(), "column-length", columnLength));
                }
                if (columnIndex != null) {
                    extensions.add(new VendorExtension(getVendorName(), "column-index", columnIndex));
                }
                if (ordered != null) {
                    extensions.add(new VendorExtension(getVendorName(), "ordered", ordered));
                }
                if (orderColumn != null) {
                    extensions.add(new VendorExtension(getVendorName(), "order-column", orderColumn));
                }
                if (readOnly != null) {
                    extensions.add(new VendorExtension(getVendorName(), "read-only", readOnly));
                }
            }

        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.