Class DefaultProjectMerger
java.lang.Object
org.apache.cayenne.project.DefaultProjectMerger
- All Implemented Interfaces:
ProjectMerger
A default implementation of
ProjectMerger. 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
project 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 project name is the same as the name of the last project on the merge list.
- Merged project settings are the same as the settings of the last project on the merge list. I.e. settings 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 project, the rest are discarded. DataMap with highest index in the project 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 project, the rest are discarded. DataNodes with highest index in the project array is chosen per precedence rule above.
- Since:
- 3.1
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultProjectMerger
public DefaultProjectMerger()
-
-
Method Details
-
merge
- Specified by:
mergein interfaceProjectMerger
-