Package org.apache.cayenne.property

Examples of org.apache.cayenne.property.PropertyAccessor


        Iterator it = entity.getDeclaredAttributes().iterator();
        while (it.hasNext()) {
            ObjAttribute attribute = (ObjAttribute) it.next();

            Class propertyType = attribute.getJavaClass();
            PropertyAccessor accessor = makeAccessor(attribute.getName(), propertyType);
            allDescriptors.put(attribute.getName(), persistent
                    ? new SimplePersistentProperty(this, accessor)
                    : new SimpleProperty(this, accessor));
        }
    }
View Full Code Here


            String reverseName = relationship.getReverseRelationshipName();

            Property property;
            if (relationship.isToMany()) {

                PropertyAccessor accessor = makeAccessor(
                        relationship.getName(),
                        List.class);

                if (dataObject) {
                    property = new ToManyListProperty(
                            this,
                            targetDescriptor,
                            accessor,
                            reverseName);
                }
                else {
                    property = new ListProperty(
                            this,
                            targetDescriptor,
                            accessor,
                            reverseName);
                }
            }
            else {

                if (dataObject) {
                    ObjEntity targetEntity = (ObjEntity) relationship.getTargetEntity();
                    PropertyAccessor accessor = makeAccessor(
                            relationship.getName(),
                            targetEntity.getJavaClass());
                    property = new PersistentObjectProperty(
                            this,
                            targetDescriptor,
                            accessor,
                            reverseName);
                }
                else {
                    PropertyAccessor accessor = makeAccessor(
                            relationship.getName(),
                            ValueHolder.class);
                    property = new ValueHolderProperty(
                            this,
                            targetDescriptor,
View Full Code Here

TOP

Related Classes of org.apache.cayenne.property.PropertyAccessor

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.