Package org.apache.cayenne.jpa.map

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


            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


            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

        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

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

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

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

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

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

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

        public void push(Object object) {

            // do descriptor injection...
            if (object instanceof JpaAttribute) {
                JpaAttribute attribute = (JpaAttribute) object;
                attribute.setName(propertyDescriptor.getName());
                attribute.setPropertyDescriptor(propertyDescriptor);
            }
            else if (object instanceof JpaManagedClass) {
                ((JpaManagedClass) object).setClassDescriptor(classDescriptor);
            }
View Full Code Here

        public void push(Object object) {

            // do descriptor injection...
            if (object instanceof JpaAttribute) {
                JpaAttribute attribute = (JpaAttribute) object;
                attribute.setName(propertyDescriptor.getName());
                attribute.setPropertyDescriptor(propertyDescriptor);
            }
            else if (object instanceof JpaManagedClass) {
                ((JpaManagedClass) object).setClassDescriptor(classDescriptor);
            }
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

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

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

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

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

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

            if (parent.getPropertyDescriptor().isStringType()) {
                if (column.getLength() <= 0) {
                    column.setLength(JpaColumn.DEFAULT_LENGTH);
                }
            }
            else {
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

        public void push(Object object) {

            // do descriptor injection...
            if (object instanceof JpaAttribute) {
                JpaAttribute attribute = (JpaAttribute) object;
                attribute.setName(propertyDescriptor.getName());
                attribute.setPropertyDescriptor(propertyDescriptor);
            }
            else if (object instanceof JpaManagedClass) {
                ((JpaManagedClass) object).setClassDescriptor(classDescriptor);
            }
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.