Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.configuration
Class DefaultDataChannelDescriptorMerger

    java.lang.Object
      org.apache.cayenne.configuration.DefaultDataChannelDescriptorMerger

All Implemented Interfaces:
  DataChannelDescriptorMerger

    public class DefaultDataChannelDescriptorMerger

extends java.lang.Object
implements DataChannelDescriptorMerger

A default implementation of `DataChannelDescriptorMerger`. The general rule of merge is that the order of descriptors on the merge list matters. If there are two conflicting metadata objects belonging to two descriptors, an object from the last descriptor takes precedence over the object from the first one. This way it is easy to override pieces of metadata. This is also similar to how DI modules are merged in Cayenne. So this is how the merge works:

- Merged descriptor name is the same as the name of the last descriptor on the merge list.
- Merged descriptor properties are the same as the properties of the last descriptor on the merge list. I.e. properties are not merged to avoid invalid combinations and unexpected runtime behavior.
- If there are two or more DataMaps with the same name, only one DataMap is placed in the merged descriptor, the rest are discarded. DataMap with highest index in the descriptor array is chosen per precedence rule above.
- If there are two or more DataNodes with the same name, only one DataNodes is placed in the merged descriptor, the rest are discarded. DataNodes with highest index in the descriptor array is chosen per precedence rule above.

Since:
  3.1

Constructor Summary
`DefaultDataChannelDescriptorMerger()`

Method Summary
`protected DataNodeDescriptor` | `cloneDataNodeDescriptor(DataNodeDescriptor original, DataChannelDescriptor targetOwner)`
`DataChannelDescriptor` | `merge(DataChannelDescriptor... descriptors)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultDataChannelDescriptorMerger

    public DefaultDataChannelDescriptorMerger()

Method Detail

### merge

    public DataChannelDescriptor merge(DataChannelDescriptor... descriptors)

  Specified by:
    `merge` in interface `DataChannelDescriptorMerger`

### cloneDataNodeDescriptor

    protected DataNodeDescriptor cloneDataNodeDescriptor(DataNodeDescriptor original,
                                                         DataChannelDescriptor targetOwner)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.