Class DBPersistenceManager

    • Field Detail

      • TYPE_INFO_MAP_BATCH_MODE

        public static final java.lang.String TYPE_INFO_MAP_BATCH_MODE
        See Also:
        Constant Field Values
      • DISALLOW_CLEAR_PARAM

        public static final java.lang.String DISALLOW_CLEAR_PARAM
        See Also:
        Constant Field Values
    • Method Detail

      • getSQLTypeDef

        public java.lang.String getSQLTypeDef​(java.lang.Class javaClass,
                                              java.lang.String ownTypeDef)
        Specified by:
        getSQLTypeDef in interface PersistenceManager
        Returns:
        the property SQL column type definition for a given java class. ( e.g. for oracle String.class would be mapped to NVARCHAR2(2000) )
      • getPersistenceInfo

        public final TypeInfoMap getPersistenceInfo​(java.lang.String code)
        Returns a TypeInfoMap instance for each composed type. These instances are cached and pre-loaded on system startup. only composed types created after startup will be analyzed and a new instance is created.

        If the instances could not be pre-load ( ususally when the system is not yet initialized ) TypeInfoMap.EMPTY_INFOMAP is returned.

        Specified by:
        getPersistenceInfo in interface PersistenceManager
        Parameters:
        code - the code of the item type aka composed type
      • createInitialPersistenceInfos

        public final java.util.Collection<PropertyTableDefinition> createInitialPersistenceInfos​(java.util.Collection types,
                                                                                                 boolean reinit)
        should only be called during initialization! this analyzes the collection of item type and creates new TypeInfoMap instances for them. the difference to loading them via getPersistenceInfo(String) or loadPersistenceInfos() is that even property features without database column are put inside the instance, provided they have a proposed column name. this assumes that the caller of this method is able to create these columns somehow.
        Specified by:
        createInitialPersistenceInfos in interface PersistenceManager
        Parameters:
        types - the initial (non-abstract) types of the system
        reinit - needed to get type manager from
        Returns:
        a collection of PropertyTableDefinition, one for each table
      • getDumpFileName

        public java.lang.String getDumpFileName()
      • reloadPersistenceInfos

        public final void reloadPersistenceInfos()
      • loadPersistenceInfos

        public final void loadPersistenceInfos()
        loads persistence info for all non-abstract types of the initialized system. this has to be called before any access to items ! otherwise accessing their properties will fail.

        for each type a instance is created and cached. these maps only contain features with present database column. you may use this to manually change a database column , shutdown the system, change you schema accordingly and restart the system again.

        Specified by:
        loadPersistenceInfos in interface PersistenceManager
      • legacyLoadPersistenceInfosInternalInTX

        public void legacyLoadPersistenceInfosInternalInTX()
      • isDestroyed

        public boolean isDestroyed()
      • isLoading

        public boolean isLoading()
      • getAllDeployments

        public java.util.Set<ItemDeployment> getAllDeployments()
      • getItemDeployment

        public ItemDeployment getItemDeployment​(java.lang.String beanOrJNDIName)
        Specified by:
        getItemDeployment in interface PersistenceManager
        Parameters:
        beanOrJNDIName - the jndi or bean name to get the deployment for
        Returns:
        the item deployment for this bean or jndi name, null if no such deployment exists
      • getDuplicatedItemDeployments

        public java.util.Map<java.lang.Integer,​ItemDeployment> getDuplicatedItemDeployments()
        Description copied from interface: PersistenceManager
        Returns a duplicated deployments by its type code. There is always inserted deployment which is deployed in DB persistance as to be redundant in compare to xml modeled one.
        Specified by:
        getDuplicatedItemDeployments in interface PersistenceManager
      • getJNDIName

        public java.lang.String getJNDIName​(int typeCode)
        Specified by:
        getJNDIName in interface PersistenceManager
        Parameters:
        typeCode - the item typecode to get the jndi name for
        Returns:
        the jndi name of the bean deployment which owns this typecode, null if no such deployment exists
      • getJNDIName

        public java.lang.String getJNDIName​(java.lang.String code)
        locates the JNDI name for a given composed type code.
        Specified by:
        getJNDIName in interface PersistenceManager
      • registerHJMPFinderListeners

        protected void registerHJMPFinderListeners​(InvalidationManager invMan)
      • clearTypeCache

        protected void clearTypeCache​(de.hybris.platform.persistence.property.DBPersistenceManager.LoadStatus newStatus)
      • getBeanTypeCodes

        public java.util.Set<java.lang.Integer> getBeanTypeCodes​(PK typePK)
        Returns a set of all beans typecode which are typed by the type of the specified pk.
        Specified by:
        getBeanTypeCodes in interface PersistenceManager
        Parameters:
        typePK - the pk of the type to get bean codes for
        Returns:
        a set of bean code strings
      • simulateFullClear

        public void simulateFullClear()
        For testing only! Do not use!
      • clearBeforeDropTables

        public void clearBeforeDropTables()
        For initialization only !
      • destroy

        public void destroy()