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(org.hibernate.SessionFactory sessionFactory, boolean realReferenceClassesUsedInExport)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<javax.persistence.metamodel.EntityType<?>,ExportableEntityInfo>
getAllExportableEntities()
Collection<ExportableEntityInfo>
getAllSiteImportableEntities()
Collection<ExportableEntityInfo>
getAllSpaceImportableEntities()
static Class<?>
getClassByClassName(String entityClassName)
String
getColumnName(Class<?> clazz, String fieldName)
ExportableEntityInfo
getEntityInfoByClass(Class<?> clazz)
String[]
getFieldNames(Class<?> clazz)
org.hibernate.type.Type[]
getHibernateTypes(Class<?> clazz)
String
getIdColumnName(Class<?> clazz)
String
getIdPropertyName(Class<?> clazz)
org.hibernate.type.Type
getIdType(Class<?> clazz)
org.hibernate.persister.entity.AbstractEntityPersister
getPersister(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-23863String
getTableName(Class<?> entityClass)
void
registerContentEntityObject(Object id, Class<?> clazz)
static String
removeQuotes(String name)
-
-
-
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
-
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)
-
getAllSpaceImportableEntities
public Collection<ExportableEntityInfo> getAllSpaceImportableEntities()
-
getAllSiteImportableEntities
public Collection<ExportableEntityInfo> getAllSiteImportableEntities()
-
-