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 Summary
Constructors Constructor Description HibernateMetadataHelper(ExportableEntityInfoFactory exportableEntityInfoFactory, org.hibernate.SessionFactory sessionFactory, boolean realReferenceClassesUsedInExport)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Class<?>,ExportableEntityInfo>getAdditionalExportableEntitiesByClass()Map<javax.persistence.metamodel.EntityType<?>,ExportableEntityInfo>getAllExportableEntities()Collection<ExportableEntityInfo>getAllSiteImportableEntities()Collection<ExportableEntityInfo>getAllSpaceImportableEntities()static Class<?>getClassByClassName(String entityClassName)StringgetColumnName(Class<?> clazz, String fieldName)ExportableEntityInfogetEntityInfoByClass(Class<?> clazz)String[]getFieldNames(Class<?> clazz)org.hibernate.type.Type[]getHibernateTypes(Class<?> clazz)StringgetIdColumnName(Class<?> clazz)StringgetIdPropertyName(Class<?> clazz)org.hibernate.type.TypegetIdType(Class<?> clazz)org.hibernate.persister.entity.AbstractEntityPersistergetPersister(Class<?> clazz)Get Hibernate persister for the class and caches it temporarily (in the instance of the helper).Class<?>getRealContentEntityObjectSubclass(Object id, Class<?> clazz)Returns content entity subclass by entity id jira.atlassian.com/browse/CONFSRVDEV-23863StringgetTableName(Class<?> entityClass)voidregisterContentEntityObject(Object id, Class<?> clazz)static StringremoveQuotes(String name)
-
-
-
Constructor Detail
-
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 Detail
-
getRealContentEntityObjectSubclass
public Class<?> getRealContentEntityObjectSubclass(Object id, Class<?> clazz)
Returns content entity subclass by entity id jira.atlassian.com/browse/CONFSRVDEV-23863
-
getAllExportableEntities
public Map<javax.persistence.metamodel.EntityType<?>,ExportableEntityInfo> getAllExportableEntities()
-
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)
-
getHibernateTypes
public org.hibernate.type.Type[] getHibernateTypes(Class<?> clazz)
-
getEntityInfoByClass
public ExportableEntityInfo getEntityInfoByClass(Class<?> clazz)
-
getAdditionalExportableEntitiesByClass
public Map<Class<?>,ExportableEntityInfo> getAdditionalExportableEntitiesByClass()
-
getAllSpaceImportableEntities
public Collection<ExportableEntityInfo> getAllSpaceImportableEntities()
-
getAllSiteImportableEntities
public Collection<ExportableEntityInfo> getAllSiteImportableEntities()
-
-