Class HibernateMetadataHelper

java.lang.Object
com.atlassian.confluence.impl.backuprestore.hibernate.HibernateMetadataHelper

public class HibernateMetadataHelper extends Object
Helps to retrieve all information about Hibernate entities.
Since:
7.20.0
  • Constructor Details

    • HibernateMetadataHelper

      public HibernateMetadataHelper(ExportableEntityInfoFactory exportableEntityInfoFactory, org.hibernate.SessionFactory sessionFactory, boolean realReferenceClassesUsedInExport)
      Parameters:
      realReferenceClassesUsedInExport - set true when external references have to have proper subclasses (like Page instead of ContentEntityObject) which is required for space backup; and false when it is not required (for site backups)
  • Method Details

    • getRealContentEntityObjectSubclass

      public Class<?> getRealContentEntityObjectSubclass(Object id, Class<?> clazz)
      Returns content entity subclass by entity id jira.atlassian.com/browse/CONFSRVDEV-23863
    • registerContentEntityObject

      public void registerContentEntityObject(Object id, Class<?> clazz)
    • getAllExportableEntities

      public Map<jakarta.persistence.metamodel.EntityType<?>,ExportableEntityInfo> getAllExportableEntities()
    • getClassByClassName

      public static Class<?> getClassByClassName(String entityClassName)
    • getTableName

      public String getTableName(Class<?> entityClass)
    • getPersister

      public org.hibernate.persister.entity.AbstractEntityPersister getPersister(Class<?> clazz)
      Get Hibernate persister for the class and caches it temporarily (in the instance of the helper).
      Parameters:
      clazz - class
      Returns:
      persister
    • getAllExportableEntitiesByClass

      public Map<Class<?>,ExportableEntityInfo> getAllExportableEntitiesByClass()
    • getIdType

      public org.hibernate.type.Type getIdType(Class<?> clazz)
    • getIdColumnName

      public String getIdColumnName(Class<?> clazz)
    • getIdPropertyName

      public String getIdPropertyName(Class<?> clazz)
    • getFieldNames

      public String[] getFieldNames(Class<?> clazz)
    • getHibernateTypes

      public org.hibernate.type.Type[] getHibernateTypes(Class<?> clazz)
    • getColumnName

      public String getColumnName(Class<?> clazz, String fieldName)
    • removeQuotes

      public static String removeQuotes(String name)
    • getEntityInfoByClass

      public ExportableEntityInfo getEntityInfoByClass(Class<?> clazz)
    • getEntityInfoByClassName

      public ExportableEntityInfo getEntityInfoByClassName(String className)
    • getAdditionalExportableEntitiesByClass

      public Map<Class<?>,ExportableEntityInfo> getAdditionalExportableEntitiesByClass()
    • getAllSpaceImportableEntities

      public Collection<ExportableEntityInfo> getAllSpaceImportableEntities()
    • getAllSiteImportableEntities

      public Collection<ExportableEntityInfo> getAllSiteImportableEntities()
    • getAllEntitiesForSpaceDeletion

      public Collection<ExportableEntityInfo> getAllEntitiesForSpaceDeletion()