public class

ReflectiveObjectPersister

extends Object
implements ObjectPersister
java.lang.Object
   ↳ com.atlassian.confluence.importexport.xmlimport.persister.ReflectiveObjectPersister

Class Overview

Uses Hibernate metadata to persist imported objects. This code is a direct port of the old import code that was scattered between ReverseDatabinder and poorly factored helper classes. Hopefully, though, it is a lot easier to understand encapsulated here. Limitations: the ReflectiveObjectPersister is NOT generic enough to persist anything you throw at it. It makes assumptions about the objects that are true of most Confluence hibernate objects: including the presence of an ID of type Long. Types that the reflective persister can not handle will need their own specific persister, for example PropertySetItemPersister.

Summary

Fields
public static final Logger log
Public Constructors
ReflectiveObjectPersister(LabelManager labelManager)
Public Methods
Object getPrimitivePropertyValue(ClassPersister entityPersister, PrimitiveProperty property)
List<TransientHibernateHandle> persist(ImportProcessorContext context, ImportedObject importedObject)
Persist a given imported object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.importexport.xmlimport.ObjectPersister

Fields

public static final Logger log

Public Constructors

public ReflectiveObjectPersister (LabelManager labelManager)

Public Methods

public Object getPrimitivePropertyValue (ClassPersister entityPersister, PrimitiveProperty property)

Throws
HibernateException

public List<TransientHibernateHandle> persist (ImportProcessorContext context, ImportedObject importedObject)

Persist a given imported object.

Parameters
context the context of the current import operation
importedObject the object to save.
Returns
  • a list of handles of the objects that were saved. If IDs are being rewritten on import, this list should still contain the pre-rewriting ID as it appears in the backup file
Throws
Exception