Class HibernateMetadataHelper


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

      • HibernateMetadataHelper

        public HibernateMetadataHelper​(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 Detail

      • 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<javax.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
      • 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)
      • removeQuotes

        public static String removeQuotes​(String name)