Class MappedSuperclassAccessor

  • Direct Known Subclasses:
    EntityAccessor

    public class MappedSuperclassAccessor
    extends ClassAccessor
    INTERNAL: A mapped superclass accessor. When adding new metadata objects, be sure to include their initialization in initXMLObject. This sets the accessible object and the location of the ORMetadata which is used when merging. Also new member metadata variables need to be added to the merge method. Key notes: - any metadata mapped from XML to this class must be compared in the equals method. - any metadata mapped from XML to this class must be handled in the merge method. (merging is done at the accessor/mapping level) - any metadata mapped from XML to this class must be initialized in the initXMLObject method. - methods should be preserved in alphabetical order.
    Since:
    TopLink EJB 3.0 Reference Implementation
    Author:
    Guy Pelletier
    • Constructor Detail

      • MappedSuperclassAccessor

        public MappedSuperclassAccessor()
        INTERNAL: Used for OX mapping.
      • MappedSuperclassAccessor

        public MappedSuperclassAccessor​(java.lang.String xmlElement)
        INTERNAL: Used for OX mapping.
    • Method Detail

      • excludeDefaultListeners

        public boolean excludeDefaultListeners()
        INTERNAL: Used for OX mapping.
      • excludeSuperclassListeners

        public boolean excludeSuperclassListeners()
        INTERNAL: Used for OX mapping.
      • getCache

        public CacheMetadata getCache()
        INTERNAL: Used for OX mapping.
      • getCacheIndexes

        public java.util.List<CacheIndexMetadata> getCacheIndexes()
        INTERNAL: Used for OX mapping.
      • getCacheable

        public java.lang.Boolean getCacheable()
        INTERNAL: Used for OX mapping.
      • getEntityListeners

        public java.util.List<EntityListenerMetadata> getEntityListeners()
        INTERNAL: Used for OX mapping.
      • getExcludeDefaultListeners

        public java.lang.Boolean getExcludeDefaultListeners()
        INTERNAL: Used for OX mapping.
      • getExcludeSuperclassListeners

        public java.lang.Boolean getExcludeSuperclassListeners()
        INTERNAL: Used for OX mapping.
      • getExistenceChecking

        public java.lang.String getExistenceChecking()
        INTERNAL: Used for OX mapping.
      • getFetchGroups

        public java.util.List<FetchGroupMetadata> getFetchGroups()
        INTERNAL: Used for OX mapping.
      • getIdClassName

        public java.lang.String getIdClassName()
        INTERNAL: Used for OX mapping.
      • getNamedNativeQueries

        public java.util.List<NamedNativeQueryMetadata> getNamedNativeQueries()
        INTERNAL: Used for OX mapping.
      • getNamedQueries

        public java.util.List<NamedQueryMetadata> getNamedQueries()
        INTERNAL: Used for OX mapping.
      • getPostLoad

        public java.lang.String getPostLoad()
        INTERNAL: Used for OX mapping.
      • getPostPersist

        public java.lang.String getPostPersist()
        INTERNAL: Used for OX mapping.
      • getPostRemove

        public java.lang.String getPostRemove()
        INTERNAL: Used for OX mapping.
      • getPostUpdate

        public java.lang.String getPostUpdate()
        INTERNAL: Used for OX mapping.
      • getPrePersist

        public java.lang.String getPrePersist()
        INTERNAL: Used for OX mapping.
      • getPreRemove

        public java.lang.String getPreRemove()
        INTERNAL: Used for OX mapping.
      • getPreUpdate

        public java.lang.String getPreUpdate()
        INTERNAL: Used for OX mapping.
      • getPrimaryKey

        public PrimaryKeyMetadata getPrimaryKey()
        INTERNAL: Used for OX mapping.
      • getReadOnly

        public java.lang.Boolean getReadOnly()
        INTERNAL: Used for OX mapping.
      • getSqlResultSetMappings

        public java.util.List<SQLResultSetMappingMetadata> getSqlResultSetMappings()
        INTERNAL: Used for OX mapping.
      • hasObjectRelationalFieldMappingAnnotationsDefined

        protected boolean hasObjectRelationalFieldMappingAnnotationsDefined()
        INTERNAL: Return true if any given field defines object relational persistence mapping annotations. This method is used when determining the access type of this accessor. Note: Through the annotation target, it is invalid to specify a lifecycle annotation on a field so we don't need to check as we do when checking the methods.
        See Also:
        processAccessType()
      • hasObjectRelationalMethodMappingAnnotationsDefined

        protected boolean hasObjectRelationalMethodMappingAnnotationsDefined()
        INTERNAL: Return true if any given method defines object relational persistence mapping annotations. This method is used when determining the access type of this accessor. Note: life cycle annotations are NOT object relational mappings therefore should not influence the decision.
        See Also:
        processAccessType()
      • initIdClass

        protected void initIdClass()
        INTERNAL: This method is called in the pre-processing stage since we want to gather a list of id classes used throughout the persistence unit. This will help us build accessors, namely, mappedById accessors that can reference an id class type.
      • isMappedSuperclass

        public boolean isMappedSuperclass()
        INTERNAL: Return whether this accessor represents a MappedSuperclass
        Overrides:
        isMappedSuperclass in class ClassAccessor
      • merge

        public void merge​(ORMetadata metadata)
        INTERNAL: Mapped-superclass level merging details. Merging is only done on accessors from XML. Since entities and embeddables are initialized before merging, for any class name specifications we can not only merge the class names but must also merge the initialized classes since we do not re-initialize class accessors after a merge. Mapped superclasses are not initialized till they are reloaded therefore merging only the class names is needed, however merging their respective MetadataClasses will do nothing since merging null with null yields null.
        Overrides:
        merge in class ClassAccessor
      • preProcess

        public void preProcess()
        INTERNAL: The pre-process method is called during regular deployment and metadata processing. This method will pre-process the items of interest on this mapped superclass for each entity class that inherits from it. The order of processing is important, care must be taken if changes must be made.
        Overrides:
        preProcess in class ClassAccessor
      • process

        public void process()
        INTERNAL: Process the items of interest on a mapped superclass.
        Overrides:
        process in class ClassAccessor
      • processAdditionalCriteria

        protected void processAdditionalCriteria()
        INTERNAL: Process the additional criteria metadata specified on an entity or mapped superclass. Once the additional criteria are processed from XML process the additional criteria from annotations. This order of processing must be maintained.
      • processAccessType

        public void processAccessType()
        INTERNAL: Process the accessType for a MappedSuperclass. This function is referenced by MetadataProject.addMetamodelMappedSuperclass(). The overridden function on the subclass must be used in all other cases.
        Specified by:
        processAccessType in class ClassAccessor
        Since:
        EclipseLink 1.2 for the JPA 2.0 Reference Implementation
      • processCache

        protected void processCache()
        INTERNAL: Process a cache metadata.
      • processCacheable

        protected void processCacheable()
        INTERNAL: Called in pre-process. It is called from an entity accessor and in turn is called on the mapped-superclasses of that entity.
      • processCacheInterceptor

        protected void processCacheInterceptor()
        INTERNAL: Process a cache interceptor metadata.
      • processCaching

        protected void processCaching()
        INTERNAL: Process a caching metadata. This method will be called on an entity's mapped superclasses (bottom --> up). We go through the mapped superclasses to not only apply a cache setting but log ignore messages.
      • processCachingMetadata

        protected void processCachingMetadata()
        INTERNAL: Process a caching metadata. These are the items we process to configure the entity's cache settings.
      • processCacheIndexes

        protected void processCacheIndexes()
        INTERNAL: Process cache index information for the given metadata descriptor.
      • processDefaultRedirectors

        protected void processDefaultRedirectors()
        INTERNAL: Process a default redirector metadata.
      • processEntityListeners

        public void processEntityListeners​(java.lang.ClassLoader loader)
        INTERNAL: Process the entity listeners for this class accessor. Entity listeners defined in XML will override those specified on the class.
      • processExcludeDefaultListeners

        protected void processExcludeDefaultListeners()
        INTERNAL: Process the exclude-default-listeners value.
      • processExcludeSuperclassListeners

        protected void processExcludeSuperclassListeners()
        INTERNAL: Process the ExcludeSuperclassListeners value if one is specified (taking metadata-complete into consideration).
      • processExistenceChecking

        protected void processExistenceChecking()
        INTERNAL: Process the ExistenceChecking value if one is specified (taking metadata-complete into consideration).
      • processFetchGroups

        protected void processFetchGroups()
        INTERNAL: Process the fetch groups for this class. We need to go through both the XML list and those defined in annotations. Must look for multiple same named fetch groups within XML and annotations and XML named fetch groups must override a similar named fetch group defined within an annotation. This method will be called from both Entity And MappedSuperclass. The fetch groups from the entity are added first followed by those from its mapped superclass(es).
      • processIdClass

        protected void processIdClass()
        INTERNAL: Process an IdClass metadata. It is used to specify composite primary keys. The primary keys will be processed and stored from the PK class so that they may be validated against the fields or properties of the entity bean. The access type of a primary key class is determined by the access type of the entity for which it is the primary key.
      • processMetamodelDescriptor

        public void processMetamodelDescriptor()
        INTERNAL: Used to process mapped superclasses when creating descriptors for a metamodel. The MappedSuperclass Descriptors here are separate from non-MappedSuperclass Descriptors.
        Since:
        EclipseLink 1.2 for the JPA 2.0 Reference Implementation
      • processMultitenant

        protected void processMultitenant()
        INTERNAL: Process the multitenant metadata specified on a mapped superclass and apply it to a sub-entity that has no multitenant metadata specified.
      • processNamedNativeQueries

        protected void processNamedNativeQueries()
        INTERNAL: Process/collect the named native queries on this accessor and add them to the project for later processing.
      • processNamedPLSQLStoredFunctionQueries

        protected void processNamedPLSQLStoredFunctionQueries()
        INTERNAL: Process/collect the named PLSQL stored function queries on this accessor and add them to the project for later processing.
      • processNamedPLSQLStoredProcedureQueries

        protected void processNamedPLSQLStoredProcedureQueries()
        INTERNAL: Process/collect the named PLSQL stored procedure queries on this accessor and add them to the project for later processing.
      • processNamedQueries

        protected void processNamedQueries()
        INTERNAL: Process/collect the named queries on this accessor and add them to the project for later processing.
      • processNamedStoredFunctionQueries

        protected void processNamedStoredFunctionQueries()
        INTERNAL: Process/collect the named stored procedure queries on this accessor and add them to the project for later processing.
      • processNamedStoredProcedureQueries

        protected void processNamedStoredProcedureQueries()
        INTERNAL: Process/collect the named stored function queries on this accessor and add them to the project for later processing.
      • processOptimisticLocking

        protected void processOptimisticLocking()
        INTERNAL: Process an OptimisticLockingMetadata.
      • processReadOnly

        protected void processReadOnly()
        INTERNAL: Process a read only setting.
      • processPrimaryKey

        protected void processPrimaryKey()
        INTERNAL: Process the primary key annotation.
      • processSequenceGenerator

        protected void processSequenceGenerator()
        INTERNAL: Process a SequenceGenerator annotation into a common metadata sequence generator and add it to the project.
      • processSerializedObjectPolicy

        protected void processSerializedObjectPolicy()
        INTERNAL: Process a SerializedObjectPolicyMetadata.
      • processSqlResultSetMappings

        protected void processSqlResultSetMappings()
        INTERNAL: Process the sql result set mappings for the given class which could be an entity or a mapped superclass.
      • processTableGenerator

        protected void processTableGenerator()
        INTERNAL: Process a TableGenerator annotation into a common metadata table generator and add it to the project.
      • processUuidGenerator

        protected void processUuidGenerator()
        INTERNAL: Process a TableGenerator annotation into a common metadata table generator and add it to the project.
      • setAdditionalCriteria

        public void setAdditionalCriteria​(AdditionalCriteriaMetadata additionalCriteria)
        INTERNAL: Used for OX mapping.
      • setCache

        public void setCache​(CacheMetadata cache)
        INTERNAL: Used for OX mapping.
      • setCacheIndexes

        public void setCacheIndexes​(java.util.List<CacheIndexMetadata> indexes)
        INTERNAL: Used for OX mapping.
      • setCacheable

        public void setCacheable​(java.lang.Boolean cacheable)
        INTERNAL: Used for OX mapping.
      • setCacheInterceptor

        public void setCacheInterceptor​(CacheInterceptorMetadata cacheInterceptor)
        INTERNAL: Used for OX mapping.
      • setEntityListeners

        public void setEntityListeners​(java.util.List<EntityListenerMetadata> entityListeners)
        INTERNAL: Used for OX mapping.
      • setExcludeDefaultListeners

        public void setExcludeDefaultListeners​(java.lang.Boolean excludeDefaultListeners)
        INTERNAL: Used for OX mapping.
      • setExcludeSuperclassListeners

        public void setExcludeSuperclassListeners​(java.lang.Boolean excludeSuperclassListeners)
        INTERNAL: Used for OX mapping
      • setExistenceChecking

        public void setExistenceChecking​(java.lang.String checking)
        INTERNAL: Used for OX mapping.
      • setFetchGroups

        public void setFetchGroups​(java.util.List<FetchGroupMetadata> fetchGroups)
        INTERNAL: Used for OX mapping.
      • setIdClass

        protected void setIdClass​(MetadataClass idClass)
        INTERNAL:
      • setIdClassName

        public void setIdClassName​(java.lang.String idClassName)
        INTERNAL: Used for OX mapping.
      • setMultitenant

        public void setMultitenant​(MultitenantMetadata multitenant)
        INTERNAL: Used for OX mapping.
      • setNamedNativeQueries

        public void setNamedNativeQueries​(java.util.List<NamedNativeQueryMetadata> namedNativeQueries)
        INTERNAL: Used for OX mapping.
      • setNamedPLSQLStoredFunctionQueries

        public void setNamedPLSQLStoredFunctionQueries​(java.util.List<NamedPLSQLStoredFunctionQueryMetadata> namedPLSQLStoredFunctionQueries)
        INTERNAL: Used for OX mapping.
      • setNamedPLSQLStoredProcedureQueries

        public void setNamedPLSQLStoredProcedureQueries​(java.util.List<NamedPLSQLStoredProcedureQueryMetadata> namedPLSQLStoredProcedureQueries)
        INTERNAL: Used for OX mapping.
      • setNamedQueries

        public void setNamedQueries​(java.util.List<NamedQueryMetadata> namedQueries)
        INTERNAL: Used for OX mapping.
      • setNamedStoredFunctionQueries

        public void setNamedStoredFunctionQueries​(java.util.List<NamedStoredFunctionQueryMetadata> namedStoredFunctionQueries)
        INTERNAL: Used for OX mapping.
      • setNamedStoredProcedureQueries

        public void setNamedStoredProcedureQueries​(java.util.List<NamedStoredProcedureQueryMetadata> namedStoredProcedureQueries)
        INTERNAL: Used for OX mapping.
      • setOptimisticLocking

        public void setOptimisticLocking​(OptimisticLockingMetadata optimisticLocking)
        INTERNAL: Used for OX mapping.
      • setPostLoad

        public void setPostLoad​(java.lang.String postLoad)
        INTERNAL: Used for OX mapping.
      • setPostPersist

        public void setPostPersist​(java.lang.String postPersist)
        INTERNAL:
      • setPostRemove

        public void setPostRemove​(java.lang.String postRemove)
        INTERNAL:
      • setPostUpdate

        public void setPostUpdate​(java.lang.String postUpdate)
        INTERNAL:
      • setPrePersist

        public void setPrePersist​(java.lang.String prePersist)
        INTERNAL:
      • setPreRemove

        public void setPreRemove​(java.lang.String preRemove)
        INTERNAL:
      • setPreUpdate

        public void setPreUpdate​(java.lang.String preUpdate)
        INTERNAL:
      • setPrimaryKey

        public void setPrimaryKey​(PrimaryKeyMetadata primaryKey)
        INTERNAL: Used for OX mapping.
      • setQueryRedirectors

        public void setQueryRedirectors​(QueryRedirectorsMetadata redirectors)
        INTERNAL: Used for OX mapping.
      • setReadOnly

        public void setReadOnly​(java.lang.Boolean readOnly)
        INTERNAL: Used for OX mapping.
      • setSequenceGenerator

        public void setSequenceGenerator​(SequenceGeneratorMetadata sequenceGenerator)
        INTERNAL: Used for OX mapping.
      • setSerializedObjectPolicy

        public void setSerializedObjectPolicy​(SerializedObjectPolicyMetadata serializedObjectPolicy)
        INTERNAL: Used for OX mapping.
      • setSqlResultSetMappings

        public void setSqlResultSetMappings​(java.util.List<SQLResultSetMappingMetadata> sqlResultSetMappings)
        INTERNAL: Used for OX mapping.
      • setTableGenerator

        public void setTableGenerator​(TableGeneratorMetadata tableGenerator)
        INTERNAL: Used for OX mapping.
      • setUuidGenerator

        public void setUuidGenerator​(UuidGeneratorMetadata uuidGenerator)
        INTERNAL: Used for OX mapping.