Examples of JpaVersion


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

        if (attribute instanceof JpaBasic) {
            JpaBasic basic = (JpaBasic) attribute;
            dbAttribute.setType(basic.getDefaultJdbcType());
        }
        else if (attribute instanceof JpaVersion) {
            JpaVersion version = (JpaVersion) attribute;
            dbAttribute.setType(version.getDefaultJdbcType());
        }

        dbAttribute.setMandatory(!column.isNullable());
        dbAttribute.setMaxLength(column.getLength());
View Full Code Here

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

        @Override
        Object createObject(ProjectPath path) {

            JpaManagedClass entity = path.firstInstanceOf(JpaManagedClass.class);
            JpaVersion version = (JpaVersion) path.getObject();

            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            ObjAttribute cayenneAttribute = new ObjAttribute(version.getName());
            cayenneAttribute.setType(getAttributeType(path, version.getName()).getName());
            cayenneAttribute.setDbAttributePath(getAttributePath(path, entity, version
                    .getColumn()));

            parentCayenneEntity.addAttribute(cayenneAttribute);
            return cayenneAttribute;
        }
View Full Code Here

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

        @Override
        Object createObject(ProjectPath path) {

            JpaManagedClass entity = path.firstInstanceOf(JpaManagedClass.class);
            JpaVersion version = (JpaVersion) path.getObject();

            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            ObjAttribute cayenneAttribute = new ObjAttribute(version.getName());
            cayenneAttribute.setType(getAttributeType(path, version.getName()).getName());
            cayenneAttribute.setDbAttributePath(getAttributePath(path, entity, version
                    .getColumn()));

            parentCayenneEntity.addAttribute(cayenneAttribute);
            return cayenneAttribute;
        }
View Full Code Here

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

    class VersionVisitor extends BasicVisitor {

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaVersion jpaBasic = (JpaVersion) path.getObject();
            if (jpaBasic.getColumn() == null) {
                JpaColumn column = new JpaColumn(AnnotationPrototypes.getColumn());
                column.setName(jpaBasic.getName());
                jpaBasic.setColumn(column);
            }

            if (jpaBasic.getTemporal() == null) {
                JpaEntity entity = (JpaEntity) path.firstInstanceOf(JpaEntity.class);
                JpaClassDescriptor descriptor = entity.getClassDescriptor();
                JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
                        .getName());

                if (Date.class.equals(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
            }

            return true;
        }
View Full Code Here

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

        @Override
        void onManagedClass(
                JpaManagedClass managedClass,
                AnnotatedElement element,
                AnnotationProcessorStack context) {
            JpaVersion attribute = new JpaVersion();
            managedClass.getAttributes().getVersionAttributes().add(attribute);
            context.push(attribute);
        }
View Full Code Here

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

        if (attribute instanceof JpaBasic) {
            JpaBasic basic = (JpaBasic) attribute;
            dbAttribute.setType(basic.getDefaultJdbcType());
        }
        else if (attribute instanceof JpaVersion) {
            JpaVersion version = (JpaVersion) attribute;
            dbAttribute.setType(version.getDefaultJdbcType());
        }

        dbAttribute.setMandatory(!column.isNullable());
        dbAttribute.setMaxLength(column.getLength());
View Full Code Here

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

        @Override
        void onManagedClass(
                JpaManagedClass managedClass,
                AnnotatedElement element,
                AnnotationProcessorStack context) {
            JpaVersion attribute = new JpaVersion();
            managedClass.getAttributes().getVersionAttributes().add(attribute);
            context.push(attribute);
        }
View Full Code Here

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

    class VersionVisitor extends BasicVisitor {

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaVersion jpaBasic = (JpaVersion) path.getObject();
            if (jpaBasic.getColumn() == null) {
                JpaColumn column = new JpaColumn(AnnotationPrototypes.getColumn());
                column.setName(jpaBasic.getName());
                jpaBasic.setColumn(column);
            }

            if (jpaBasic.getTemporal() == null) {
                JpaEntity entity = (JpaEntity) path.firstInstanceOf(JpaEntity.class);
                JpaClassDescriptor descriptor = entity.getClassDescriptor();
                JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
                        .getName());

                if (Date.class.equals(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
            }

            return true;
        }
View Full Code Here

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

        @Override
        Object createObject(ProjectPath path) {

            JpaManagedClass entity = path.firstInstanceOf(JpaManagedClass.class);
            JpaVersion version = (JpaVersion) path.getObject();

            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            ObjAttribute cayenneAttribute = new ObjAttribute(version.getName());
            cayenneAttribute.setType(getAttributeType(path, version.getName()).getName());
            cayenneAttribute.setDbAttributePath(getAttributePath(path, entity, version
                    .getColumn()));

            parentCayenneEntity.addAttribute(cayenneAttribute);
            return cayenneAttribute;
        }
View Full Code Here

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

        if (attribute instanceof JpaBasic) {
            JpaBasic basic = (JpaBasic) attribute;
            dbAttribute.setType(basic.getDefaultJdbcType());
        }
        else if (attribute instanceof JpaVersion) {
            JpaVersion version = (JpaVersion) attribute;
            dbAttribute.setType(version.getDefaultJdbcType());
        }

        dbAttribute.setMandatory(!column.isNullable());
        dbAttribute.setMaxLength(column.getLength());
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.