Package org.apache.cayenne.jpa.map

Examples of org.apache.cayenne.jpa.map.JpaAttribute


    class JpaColumnVisitor extends BaseTreeVisitor {

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaColumn jpaColumn = (JpaColumn) path.getObject();
            JpaAttribute attribute = (JpaAttribute) path.getObjectParent();

            DbAttribute dbAttribute = new DbAttribute(jpaColumn.getName());

            if (attribute instanceof JpaBasic) {
                JpaBasic basic = (JpaBasic) attribute;
View Full Code Here


        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaColumn column = (JpaColumn) path.getObject();

            JpaAttribute parent = (JpaAttribute) path.firstInstanceOf(JpaAttribute.class);

            if (column.getName() == null) {
                column.setName(parent.getName());
            }

            if (column.getTable() == null) {
                JpaEntity entity = (JpaEntity) path.firstInstanceOf(JpaEntity.class);

                // parent can be a mapped superclass
                if (entity != null) {
                    column.setTable(entity.getTable().getName());
                }
            }

            if (parent.getPropertyDescriptor().isStringType()) {
                if (column.getLength() <= 0) {
                    column.setLength(JpaColumn.DEFAULT_LENGTH);
                }
            }
            else {
View Full Code Here

        public void onStartElement(
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            JpaAttribute attribute = null;

            Object parent = context.peek();
            if (parent instanceof JpaAttribute) {
                attribute = (JpaAttribute) parent;
            }
View Full Code Here

            if (jpaColumn.getTable() == null) {
                throw new JpaProviderException("No default table defined for JpaColumn "
                        + jpaColumn.getName());
            }

            JpaAttribute attribute = (JpaAttribute) path.getObjectParent();
            createDbAttribute(jpaColumn.getTable(), jpaColumn, attribute);
            return false;
        }
View Full Code Here

    class JpaColumnVisitor extends BaseTreeVisitor {

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaColumn jpaColumn = (JpaColumn) path.getObject();
            JpaAttribute attribute = (JpaAttribute) path.getObjectParent();

            DbAttribute dbAttribute = new DbAttribute(jpaColumn.getName());

            if (attribute instanceof JpaBasic) {
                JpaBasic basic = (JpaBasic) attribute;
View Full Code Here

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaColumn column = (JpaColumn) path.getObject();

            JpaAttribute parent = (JpaAttribute) path.firstInstanceOf(JpaAttribute.class);

            if (column.getName() == null) {
                column.setName(parent.getName());
            }

            if (column.getTable() == null) {
                JpaEntity entity = (JpaEntity) path.firstInstanceOf(JpaEntity.class);
                column.setTable(entity.getTable().getName());
            }

            if (parent.getPropertyDescriptor().isStringType()) {
                if (column.getLength() < 0) {
                    column.setLength(255);
                }
            }
            else {
View Full Code Here

TOP

Related Classes of org.apache.cayenne.jpa.map.JpaAttribute

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.