Search in sources :

Example 1 with Accessor

use of org.apache.cayenne.reflect.Accessor in project cayenne by apache.

the class ValueHolderDescriptorFactory method createToOneProperty.

@Override
protected void createToOneProperty(PersistentDescriptor descriptor, ObjRelationship relationship) {
    ClassDescriptor targetDescriptor = descriptorMap.getDescriptor(relationship.getTargetEntityName());
    String reverseName = relationship.getReverseRelationshipName();
    Accessor accessor = createAccessor(descriptor, relationship.getName(), ValueHolder.class);
    PropertyDescriptor property = new ValueHolderProperty(descriptor, targetDescriptor, accessor, reverseName);
    descriptor.addDeclaredProperty(property);
}
Also used : ClassDescriptor(org.apache.cayenne.reflect.ClassDescriptor) PropertyDescriptor(org.apache.cayenne.reflect.PropertyDescriptor) Accessor(org.apache.cayenne.reflect.Accessor)

Example 2 with Accessor

use of org.apache.cayenne.reflect.Accessor in project cayenne by apache.

the class ValueHolderDescriptorFactory method createToManySetProperty.

@Override
protected void createToManySetProperty(PersistentDescriptor descriptor, ObjRelationship relationship) {
    ClassDescriptor targetDescriptor = descriptorMap.getDescriptor(relationship.getTargetEntityName());
    String reverseName = relationship.getReverseRelationshipName();
    Accessor accessor = createAccessor(descriptor, relationship.getName(), Set.class);
    descriptor.addDeclaredProperty(new ValueHolderSetProperty(descriptor, targetDescriptor, accessor, reverseName));
}
Also used : ClassDescriptor(org.apache.cayenne.reflect.ClassDescriptor) Accessor(org.apache.cayenne.reflect.Accessor)

Example 3 with Accessor

use of org.apache.cayenne.reflect.Accessor in project cayenne by apache.

the class DataObjectDescriptorFactory method createToManyMapProperty.

@Override
protected void createToManyMapProperty(PersistentDescriptor descriptor, ObjRelationship relationship) {
    ClassDescriptor targetDescriptor = descriptorMap.getDescriptor(relationship.getTargetEntityName());
    Accessor mapKeyAccessor = createMapKeyAccessor(relationship, targetDescriptor);
    descriptor.addDeclaredProperty(new DataObjectToManyMapProperty(relationship, targetDescriptor, faultFactory.getMapFault(mapKeyAccessor), mapKeyAccessor));
}
Also used : ClassDescriptor(org.apache.cayenne.reflect.ClassDescriptor) Accessor(org.apache.cayenne.reflect.Accessor)

Example 4 with Accessor

use of org.apache.cayenne.reflect.Accessor in project cayenne by apache.

the class ValueHolderDescriptorFactory method createToManyListProperty.

@Override
protected void createToManyListProperty(PersistentDescriptor descriptor, ObjRelationship relationship) {
    ClassDescriptor targetDescriptor = descriptorMap.getDescriptor(relationship.getTargetEntityName());
    String reverseName = relationship.getReverseRelationshipName();
    Accessor accessor = createAccessor(descriptor, relationship.getName(), List.class);
    descriptor.addDeclaredProperty(new ValueHolderListProperty(descriptor, targetDescriptor, accessor, reverseName));
}
Also used : ClassDescriptor(org.apache.cayenne.reflect.ClassDescriptor) Accessor(org.apache.cayenne.reflect.Accessor)

Example 5 with Accessor

use of org.apache.cayenne.reflect.Accessor in project cayenne by apache.

the class ValueHolderDescriptorFactory method createToManyCollectionProperty.

@Override
protected void createToManyCollectionProperty(PersistentDescriptor descriptor, ObjRelationship relationship) {
    ClassDescriptor targetDescriptor = descriptorMap.getDescriptor(relationship.getTargetEntityName());
    String reverseName = relationship.getReverseRelationshipName();
    Accessor accessor = createAccessor(descriptor, relationship.getName(), List.class);
    descriptor.addDeclaredProperty(new ValueHolderListProperty(descriptor, targetDescriptor, accessor, reverseName));
}
Also used : ClassDescriptor(org.apache.cayenne.reflect.ClassDescriptor) Accessor(org.apache.cayenne.reflect.Accessor)

Aggregations

Accessor (org.apache.cayenne.reflect.Accessor)6 ClassDescriptor (org.apache.cayenne.reflect.ClassDescriptor)6 PropertyDescriptor (org.apache.cayenne.reflect.PropertyDescriptor)2