Package org.springframework.roo.addon.dbre.model

Examples of org.springframework.roo.addon.dbre.model.Column


    }

    private AnnotationMetadataBuilder getJoinColumnAnnotation(
            final Reference reference, final boolean referencedColumn,
            final JavaType fieldType, final Boolean nullable) {
        final Column localColumn = reference.getLocalColumn();
        Validate.notNull(localColumn, "Foreign-key reference local column '"
                + reference.getLocalColumnName() + "' must not be null");
        final AnnotationMetadataBuilder joinColumnBuilder = new AnnotationMetadataBuilder(
                JOIN_COLUMN);
        joinColumnBuilder
                .addStringAttribute(NAME, localColumn.getEscapedName());

        if (referencedColumn) {
            final Column foreignColumn = reference.getForeignColumn();
            Validate.notNull(
                    foreignColumn,
                    "Foreign-key reference foreign column '%s' must not be null",
                    reference.getForeignColumnName());
            joinColumnBuilder.addStringAttribute("referencedColumnName",
                    foreignColumn.getEscapedName());
        }

        if (nullable == null) {
            if (localColumn.isRequired()) {
                joinColumnBuilder.addBooleanAttribute("nullable", false);
View Full Code Here

TOP

Related Classes of org.springframework.roo.addon.dbre.model.Column

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.