public abstract class GenericMapper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DATABASE_DATE_FORMAT |
protected org.slf4j.Logger |
logger |
protected static String |
PLUGIN_KEY_PREFIX |
protected static String |
XML_DATE_FORMAT |
| Constructor and Description |
|---|
GenericMapper(org.hibernate.SessionFactory sessionFactory,
BatchProcessor batchProcessor) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> void |
addEntities(List<T> entitiesToPersist,
HibernateOperation<org.hibernate.Session> hibernateOperation)
Replicates a collection of Hibernate persistable entities using the batch processor.
|
protected <T> void |
addEntitiesViaMerge(List<T> entitiesToPersist)
Replicates a collection of Hibernate persistable entities using the batch processor.
|
protected <T> void |
addEntitiesViaReplicate(List<T> entitiesToPersist)
Replicates a collection of Hibernate persistable entities using the batch processor.
|
protected void |
addEntity(Object entityToPersist)
Replicates a Hibernate persistable entity.
|
protected <T extends Serializable,E extends Serializable> |
addEntity(TransactionGroup<T,E> entitiesToPersist)
Replicates a collection of Hibernate persistable entities using the batch processor.
|
protected Object |
addEntityViaMerge(Object entityToPersist)
Replicates a Hibernate persistable entity.
|
protected Object |
addEntityViaSave(Object entityToPersist)
Replicates a Hibernate persistable entity.
|
protected void |
clearSession() |
protected String |
getAttributeValue(String name,
Map<String,Set<String>> attributes,
String defaultValue) |
String |
getDateAsFormattedString(Date date)
Serialises a date/time to String in a standard format.
|
Date |
getDateFromDatabase(String dateString) |
Date |
getDateFromXml(String dateString)
Obtains a date object from a serialised string.
|
protected DirectoryType |
getDirectoryTypeFromLegacyCode(int code) |
protected String |
getNameFromLegacyCode(String codeName) |
protected OperationType |
getOperationTypeFromLegacyPermissionName(String name) |
org.hibernate.SessionFactory |
getSessionFactory() |
protected final org.slf4j.Logger logger
protected static final String XML_DATE_FORMAT
protected static final String DATABASE_DATE_FORMAT
protected static final String PLUGIN_KEY_PREFIX
public GenericMapper(org.hibernate.SessionFactory sessionFactory,
BatchProcessor batchProcessor)
public String getDateAsFormattedString(Date date)
date - date to serialise.public Date getDateFromXml(String dateString)
dateString - serialised string.protected void addEntity(Object entityToPersist) throws ImportException
entityToPersist - entity to replicate.ImportExceptionprotected <T> void addEntities(List<T> entitiesToPersist, HibernateOperation<org.hibernate.Session> hibernateOperation) throws org.hibernate.HibernateException
entitiesToPersist - entity to replicate.hibernateOperation - the operation to perform on the entitiesorg.hibernate.HibernateExceptionprotected <T> void addEntitiesViaReplicate(List<T> entitiesToPersist) throws org.hibernate.HibernateException
entitiesToPersist - entity to replicate.org.hibernate.HibernateExceptionprotected <T> void addEntitiesViaMerge(List<T> entitiesToPersist) throws org.hibernate.HibernateException
entitiesToPersist - entity to replicate.org.hibernate.HibernateExceptionprotected <T extends Serializable,E extends Serializable> void addEntity(TransactionGroup<T,E> entitiesToPersist) throws org.hibernate.HibernateException
entitiesToPersist - transaction group containing primary and dependent entities.org.hibernate.HibernateExceptionprotected Object addEntityViaMerge(Object entityToPersist) throws ImportException
entityToPersist - entity to replicate.ImportException - error persisting.protected Object addEntityViaSave(Object entityToPersist) throws ImportException
entityToPersist - entity to replicate.ImportException - error persisting.public org.hibernate.SessionFactory getSessionFactory()
protected OperationType getOperationTypeFromLegacyPermissionName(String name)
protected String getAttributeValue(String name, Map<String,Set<String>> attributes, String defaultValue)
protected DirectoryType getDirectoryTypeFromLegacyCode(int code)
protected void clearSession()
Copyright © 2018 Atlassian. All rights reserved.