Class TransformerFactory

    • Constructor Detail

      • TransformerFactory

        public TransformerFactory​(Session session,
                                  Collection<MetadataClass> entityClasses,
                                  ClassLoader classLoader,
                                  boolean weaveLazy,
                                  boolean weaveChangeTracking,
                                  boolean weaveFetchGroups,
                                  boolean weaveInternal,
                                  boolean weaveRest,
                                  boolean weaveMappedSuperClass)
    • Method Detail

      • createTransformerAndModifyProject

        public static PersistenceWeaver createTransformerAndModifyProject​(Session session,
                                                                          Collection<MetadataClass> entityClasses,
                                                                          ClassLoader classLoader,
                                                                          boolean weaveLazy,
                                                                          boolean weaveChangeTracking,
                                                                          boolean weaveFetchGroups,
                                                                          boolean weaveInternal,
                                                                          boolean weaveRest,
                                                                          boolean weaveMappedSuperClass)
      • addClassDetailsForMappedSuperClasses

        public void addClassDetailsForMappedSuperClasses​(MetadataClass clz,
                                                         ClassDescriptor initialDescriptor,
                                                         ClassDetails classDetails,
                                                         Map<String,​ClassDetails> classDetailsMap,
                                                         List<DatabaseMapping> unMappedAttributes,
                                                         boolean weaveChangeTracking)
        INTERNAL: Look higher in the hierarchy for the mappings listed in the unMappedAttribute list. We assume that if a mapping exists, the attribute must either be mapped from the owning class or from a superclass.
      • buildClassDetailsAndModifyProject

        public void buildClassDetailsAndModifyProject()
        Build a list ClassDetails instance that contains a ClassDetails for each class in our entities list.
      • canChangeTrackingBeEnabled

        protected boolean canChangeTrackingBeEnabled​(ClassDescriptor descriptor,
                                                     MetadataClass clz,
                                                     boolean globalWeaveChangeTracking)
        Check to ensure the class meets all the conditions necessary to enable change tracking This could occur either if the class already has change tracking implemented or if the class is capable of having change tracking woven based on the descriptor.
      • wasChangeTrackingAlreadyWeaved

        protected boolean wasChangeTrackingAlreadyWeaved​(Class<?> clz)
      • canWeaveValueHolders

        protected boolean canWeaveValueHolders​(MetadataClass clz,
                                               List<DatabaseMapping> mappings)
        Determine if value holders are required to be weaved into the class.
      • findDescriptor

        protected ClassDescriptor findDescriptor​(Project project,
                                                 String className)
        Find a descriptor by name in the given project used to avoid referring to descriptors by class. This avoids having to construct a project by class facilitating weaving
      • hasFieldInClass

        protected boolean hasFieldInClass​(MetadataClass metadataClass,
                                          String attributeName)
        Return if the class contains the field.
      • storeAttributeMappings

        protected List<DatabaseMapping> storeAttributeMappings​(MetadataClass metadataClass,
                                                               ClassDetails classDetails,
                                                               List<DatabaseMapping> mappings,
                                                               boolean weaveValueHolders)
        INTERNAL: Store a set of attribute mappings on the given ClassDetails that correspond to the given class. Return the list of mappings that is not specifically found on the given class. These attributes will be found on MappedSuperclasses.
      • log

        protected void log​(int level,
                           String msg,
                           Object[] params)