Class DBPersistenceManager

java.lang.Object
de.hybris.platform.persistence.property.DBPersistenceManager
All Implemented Interfaces:
PersistenceManager

public class DBPersistenceManager extends Object implements PersistenceManager
  • Field Details

  • Constructor Details

  • Method Details

    • getSQLTypeDef

      public String getSQLTypeDef(Class javaClass, 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) )
    • cache

      protected final PersistenceInfoCache cache()
    • getPersistenceInfo

      public final TypeInfoMap getPersistenceInfo(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
    • getPersistenceInfo

      public final TypeInfoMap getPersistenceInfo(PK typePK)
      Specified by:
      getPersistenceInfo in interface PersistenceManager
    • getInitialPersistenceInfos

      public PropertyTableDefinition getInitialPersistenceInfos(ComposedTypeRemote type, boolean reinit)
      Specified by:
      getInitialPersistenceInfos in interface PersistenceManager
    • createInitialPersistenceInfos

      public final Collection<PropertyTableDefinition> createInitialPersistenceInfos(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 String getDumpFileName()
    • restorePersistenceInfoCache

      protected PersistenceInfoCache restorePersistenceInfoCache()
    • dumpPersistenceInfoCache

      protected void dumpPersistenceInfoCache(PersistenceInfoCache pic)
    • 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()
    • cachesInfoFor

      public boolean cachesInfoFor(PK typePK)
      Specified by:
      cachesInfoFor in interface PersistenceManager
    • isLoaded

      public boolean isLoaded()
      Specified by:
      isLoaded in interface PersistenceManager
    • isDestroyed

      public boolean isDestroyed()
    • isLoading

      public boolean isLoading()
    • getAllDeployments

      public Set<ItemDeployment> getAllDeployments()
    • getItemDeployment

      public ItemDeployment getItemDeployment(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 Map<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
    • getItemDeployment

      public ItemDeployment getItemDeployment(int tc)
      Specified by:
      getItemDeployment in interface PersistenceManager
    • getAllSubDeployments

      public Collection<ItemDeployment> getAllSubDeployments(ItemDeployment depl)
      Specified by:
      getAllSubDeployments in interface PersistenceManager
    • getJNDIName

      public 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 String getJNDIName(String code)
      locates the JNDI name for a given composed type code.
      Specified by:
      getJNDIName in interface PersistenceManager
    • getTypePK

      public PK getTypePK(String code)
      Specified by:
      getTypePK in interface PersistenceManager
    • isRootRelationType

      public boolean isRootRelationType(String code)
      Specified by:
      isRootRelationType in interface PersistenceManager
    • getExternalTableTypes

      public Set<PK> getExternalTableTypes(PK typePK)
      Description copied from interface: PersistenceManager
      Finds all subtypes of a given non-abstract type which are mapped to a different deployment.
      Specified by:
      getExternalTableTypes in interface PersistenceManager
    • registerHJMPFinderListeners

      protected void registerHJMPFinderListeners(InvalidationManager invMan)
    • clearComposedType

      public void clearComposedType(PK typePK, String code)
      Specified by:
      clearComposedType in interface PersistenceManager
    • clearTypeCache

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

      public Set<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()