Class MetaDataMerger

java.lang.Object
org.datanucleus.metadata.MetaDataMerger

public class MetaDataMerger extends Object
Convenience class to handle the merging of MetaData. This is used in the following situations
  • JDO : Merging ORM MetaData into JDO MetaData
  • JPA : Merging Annotations information into JPA MetaData
  • JDO : Merging Annotations information into JDO MetaData
  • Constructor Details

    • MetaDataMerger

      public MetaDataMerger()
  • Method Details

    • mergeFileORMData

      public static void mergeFileORMData(FileMetaData primaryFmd, FileMetaData ormFmd)
      Method to take a file JDO MetaData definition and merge in the ORM MetaData definition. If something is specified in the JDO MetaData and also in the ORM MetaData then the ORM MetaData takes precedence.
      Parameters:
      primaryFmd - The JDO Field definition (to be updated)
      ormFmd - The ORM Field definition (to be merged into the JDO Field definition)
      Throws:
      NucleusException - if an error occurs while merging the ORM info
    • mergeClassORMData

      public static void mergeClassORMData(AbstractClassMetaData primaryCmd, AbstractClassMetaData ormCmd, MetaDataManager mmgr)
      Method to take a class JDO MetaData definition and merge in the ORM MetaData definition. If something is specified in the JDO MetaData and also in the ORM MetaData then the ORM MetaData takes precedence. This is tied pretty intrinsically to the AbstractClassMetaData class and so could have been included there.
      Parameters:
      primaryCmd - The JDO Class definition (to be updated)
      ormCmd - The ORM Class definition (to be merged into the JDO Class definition)
      mmgr - MetaData manager
      Throws:
      NucleusException - if an error occurs while merging the ORM info
    • mergeMemberORMData

      static void mergeMemberORMData(AbstractMemberMetaData primaryFmd, AbstractMemberMetaData ormFmd)
      Method to take a field JDO MetaData definition and merge in the ORM MetaData definition. This is tied pretty intrinsically to the AbstractMemberMetaData class and so could have been included there.
      Parameters:
      primaryFmd - The JDO Field definition (to be updated)
      ormFmd - The ORM Field definition (to be merged into the JDO Class definition)
      Throws:
      NucleusException - if an error occurs while merging the ORM info
    • mergeClassAnnotationsData

      public static void mergeClassAnnotationsData(AbstractClassMetaData primaryCmd, AbstractClassMetaData annotCmd, MetaDataManager mmgr)
      Method to take a class XML metadata definition and merge in any Annotations metadata definition. If something is specified in the XML and also in the annotations then the XML takes precedence. This is tied pretty intrinsically to the AbstractClassMetaData class and so could have been included there.
      Parameters:
      primaryCmd - The XML metadata definition (to be updated)
      annotCmd - The annotations metadata definition (to be merged into the XML definition)
      mmgr - MetaData manager
      Throws:
      NucleusException - if an error occurs while merging the annotations info
    • mergeMemberAnnotationsData

      static void mergeMemberAnnotationsData(AbstractMemberMetaData primaryFmd, AbstractMemberMetaData annotFmd)
      Method to take a field/property XML metadata definition and merge in the Annotations metadata definition. This is tied pretty intrinsically to the AbstractMemberMetaData class and so could have been included there.
      Parameters:
      primaryFmd - The XML metadata Field definition (to be updated)
      annotFmd - The Annotations metadata Field definition (to be merged into the XML definition)
      Throws:
      NucleusException - if an error occurs while merging the annotation info