Examples of JpaPropertyDescriptor


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

                        .firstInstanceOf(JpaManagedClass.class);

                String name = relationship.getName();

                JpaClassDescriptor srcDescriptor = relationshipOwner.getClassDescriptor();
                JpaPropertyDescriptor property = srcDescriptor.getProperty(name);

                Class<?> targetEntityType = property.getTargetEntityType();

                if (targetEntityType == null) {
                    context.recordConflict(new SimpleValidationFailure(property
                            .getMember(), "Undefined target entity type: " + name));
                    return false;
                }
                else {
                    relationship.setTargetEntityName(targetEntityType.getName());
View Full Code Here

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

                    .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) {
                    throw new IllegalStateException("No class property found for name: "
                            + jpaBasic.getName());
                }

                if (java.sql.Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.DATE);
                }
                else if (Time.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIME);
                }
                else if (Timestamp.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (property.getType().isEnum()) {
                    jpaBasic.setEnumerated(EnumType.ORDINAL);
                }
            }

            return true;
View Full Code Here

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

            }

            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.JpaPropertyDescriptor

                && managedClass.getAttributes().getAttribute(property) != null;
    }

    @Override
    protected boolean isLazyFaulted(String property) {
        JpaPropertyDescriptor propertyDescriptor = managedClass
                .getClassDescriptor()
                .getProperty(property);

        // TODO: andrus, 10/14/2006 - this should access Jpa LAZY vs. EAGER flag
        // instead of using Cayenne default logic of lazy relationships
        return propertyDescriptor != null
                && propertyDescriptor.getTargetEntityType() != null;
    }
View Full Code Here

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

                && managedClass.getAttributes().getAttribute(property) != null;
    }

    @Override
    protected boolean isLazyFaulted(String property) {
        JpaPropertyDescriptor propertyDescriptor = managedClass
                .getClassDescriptor()
                .getProperty(property);

        // TODO: andrus, 10/14/2006 - this should access Jpa LAZY vs. EAGER flag
        // instead of using Cayenne default logic of lazy relationships
        return propertyDescriptor != null
                && propertyDescriptor.getTargetEntityType() != null;
    }
View Full Code Here

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

                        .firstInstanceOf(JpaManagedClass.class);

                String name = relationship.getName();

                JpaClassDescriptor srcDescriptor = relationshipOwner.getClassDescriptor();
                JpaPropertyDescriptor property = srcDescriptor.getProperty(name);

                Class<?> targetEntityType = property.getTargetEntityType();

                if (targetEntityType == null) {
                    context.recordConflict(new SimpleValidationFailure(property
                            .getMember(), "Undefined target entity type: " + name));
                    return false;
                }
                else {
                    relationship.setTargetEntityName(targetEntityType.getName());
View Full Code Here

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

                    .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) {
                    throw new IllegalStateException("No class property found for name: "
                            + jpaBasic.getName());
                }

                if (java.sql.Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.DATE);
                }
                else if (Time.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIME);
                }
                else if (Timestamp.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (property.getType().isEnum()) {
                    jpaBasic.setEnumerated(EnumType.ORDINAL);
                }
            }

            return true;
View Full Code Here

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

            }

            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.JpaPropertyDescriptor

                        .firstInstanceOf(JpaManagedClass.class);

                String name = relationship.getName();

                JpaClassDescriptor srcDescriptor = relationshipOwner.getClassDescriptor();
                JpaPropertyDescriptor property = srcDescriptor.getProperty(name);

                Class targetEntityType = property.getTargetEntityType();

                if (targetEntityType == null) {
                    context.recordConflict(new SimpleValidationFailure(property
                            .getMember(), "Undefined target entity type: " + name));
                    return false;
                }
                else {
                    relationship.setTargetEntityName(targetEntityType.getName());
View Full Code Here

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

                    .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) {
                    throw new IllegalStateException("No class property found for name: "
                            + jpaBasic.getName());
                }

                if (java.sql.Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.DATE);
                }
                else if (Time.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIME);
                }
                else if (Timestamp.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (Date.class.isAssignableFrom(property.getType())) {
                    jpaBasic.setTemporal(TemporalType.TIMESTAMP);
                }
                else if (property.getType().isEnum()) {
                    jpaBasic.setEnumerated(EnumType.ORDINAL);
                }
            }

            return true;
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.