Examples of JpaAbstractEntity


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

                column.setName(jpaBasic.getName());
                column.setNullable(jpaBasic.isOptional());
                jpaBasic.setColumn(column);
            }

            JpaAbstractEntity entity = (JpaAbstractEntity) path
                    .firstInstanceOf(JpaAbstractEntity.class);

            // process temporal type defaults
            if (jpaBasic.getTemporal() == null && jpaBasic.getEnumerated() == null) {
                JpaClassDescriptor descriptor = entity.getClassDescriptor();
                JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
                        .getName());

                // sanity check
                if (property == null) {
View Full Code Here

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

            addChildVisitor(JpaId.class, new IdVisitor());
        }

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaAbstractEntity abstractEntity = (JpaAbstractEntity) path.getObject();

            // * entity name
            if (abstractEntity.getClassName() == null) {
                return false;
            }

            if (abstractEntity.getAttributes() == null) {
                abstractEntity.setAttributes(new JpaAttributes());
            }

            // * default persistent fields
            JpaClassDescriptor descriptor = abstractEntity.getClassDescriptor();

            AccessType access = abstractEntity.getAccess();
            if (access == null) {
                access = ((JpaEntityMap) path.getRoot()).getAccess();
                abstractEntity.setAccess(access);
            }

            if (access == AccessType.PROPERTY) {
                for (JpaPropertyDescriptor candidate : descriptor
                        .getPropertyDescriptors()) {
View Full Code Here

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

            addChildVisitor(JpaId.class, new IdVisitor());
        }

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaAbstractEntity abstractEntity = (JpaAbstractEntity) path.getObject();

            // * entity name
            if (abstractEntity.getClassName() == null) {
                return false;
            }

            if (abstractEntity.getAttributes() == null) {
                abstractEntity.setAttributes(new JpaAttributes());
            }

            // * default persistent fields
            JpaClassDescriptor descriptor = abstractEntity.getClassDescriptor();

            AccessType access = abstractEntity.getAccess();
            if (access == null) {
                access = ((JpaEntityMap) path.getRoot()).getAccess();
                abstractEntity.setAccess(access);
            }

            if (access == AccessType.PROPERTY) {
                for (JpaPropertyDescriptor candidate : descriptor
                        .getPropertyDescriptors()) {
View Full Code Here

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

                column.setName(jpaBasic.getName());
                column.setNullable(jpaBasic.isOptional());
                jpaBasic.setColumn(column);
            }

            JpaAbstractEntity entity = (JpaAbstractEntity) path
                    .firstInstanceOf(JpaAbstractEntity.class);

            // process temporal type defaults
            if (jpaBasic.getTemporal() == null && jpaBasic.getEnumerated() == null) {
                JpaClassDescriptor descriptor = entity.getClassDescriptor();
                JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
                        .getName());

                // sanity check
                if (property == null) {
View Full Code Here

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

            addChildVisitor(JpaId.class, new IdVisitor());
        }

        @Override
        public boolean onStartNode(ProjectPath path) {
            JpaAbstractEntity abstractEntity = (JpaAbstractEntity) path.getObject();

            // * entity name
            if (abstractEntity.getClassName() == null) {
                return false;
            }

            if (abstractEntity instanceof JpaEntity) {
                JpaEntity entity = (JpaEntity) abstractEntity;
                if (entity.getName() == null) {
                    // use unqualified class name
                    String fqName = abstractEntity.getClassName();
                    int split = fqName.lastIndexOf('.');
                    entity.setName(split > 0 ? fqName.substring(split + 1) : fqName);
                }

                // * default table (see @Table annotation defaults, JPA spec 9.1.1)
                if (entity.getTable() == null) {
                    JpaTable table = new JpaTable(AnnotationPrototypes.getTable());

                    // unclear whether we need to apply any other name transformations ...
                    // or even if we need to uppercase the name. Per default examples
                    // looks
                    // like we need. table.setName(entity.getName().toUpperCase());
                    table.setName(entity.getName());
                    entity.setTable(table);
                }
            }

            if (abstractEntity.getAttributes() == null) {
                abstractEntity.setAttributes(new JpaAttributes());
            }

            // * default persistent fields
            JpaClassDescriptor descriptor = abstractEntity.getClassDescriptor();

            AccessType access = abstractEntity.getAccess();
            if (access == null) {
                access = ((JpaEntityMap) path.getRoot()).getAccess();
                abstractEntity.setAccess(access);
            }

            if (access == AccessType.PROPERTY) {
                for (JpaPropertyDescriptor candidate : descriptor
                        .getPropertyDescriptors()) {
View Full Code Here

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

                column.setName(jpaBasic.getName());
                column.setNullable(jpaBasic.isOptional());
                jpaBasic.setColumn(column);
            }

            JpaAbstractEntity entity = (JpaAbstractEntity) path
                    .firstInstanceOf(JpaAbstractEntity.class);

            // process temporal type defaults
            if (jpaBasic.getTemporal() == null && jpaBasic.getEnumerated() == null) {
                JpaClassDescriptor descriptor = entity.getClassDescriptor();
                JpaPropertyDescriptor property = descriptor.getProperty(jpaBasic
                        .getName());

                // sanity check
                if (property == null) {
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.