|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.migration.BambooStAXMappingHelperAbstractImpl<T>
T
- public abstract class BambooStAXMappingHelperAbstractImpl<T>
Skeleton implementation of StAX based export-import helper class
The XML representation of such an object is:
Constructor Summary | |
---|---|
protected |
BambooStAXMappingHelperAbstractImpl(net.sf.hibernate.SessionFactory sessionFactory)
|
Method Summary | |
---|---|
protected void |
commitClearSession(net.sf.hibernate.Session session)
Utility method for clearing the Hibernate session |
protected void |
commitSession(net.sf.hibernate.Session session)
Utility method for committing the Hibernate session |
protected abstract T |
createItemInstance(org.codehaus.staxmate.in.SMInputCursor inputCursor)
Creates empty instance of the imported object |
protected org.codehaus.staxmate.out.SMOutputElement |
createRootElement(org.codehaus.staxmate.out.SMOutputElement outputElement)
Create root node for the exported object. |
protected void |
exportProperties(org.codehaus.staxmate.out.SMOutputElement outputElement,
T object,
net.sf.hibernate.Session session)
Export object properties. |
void |
exportXml(net.sf.hibernate.Session session,
org.codehaus.staxmate.out.SMOutputElement outputElement,
T object)
Implementation of object export. |
protected void |
exportXml(org.codehaus.staxmate.out.SMOutputElement outputElement,
T object)
Implementation of object export. |
protected net.sf.hibernate.Session |
getSession()
Get the Hibernate session |
net.sf.hibernate.SessionFactory |
getSessionFactory()
|
protected void |
importProperties(T object,
org.codehaus.staxmate.in.SMInputCursor inputCursor,
net.sf.hibernate.Session session)
Import properties to the object. |
T |
importXml(net.sf.hibernate.Session session,
org.codehaus.staxmate.in.SMInputCursor inputCursor)
Implementation of object import. |
protected T |
importXml(org.codehaus.staxmate.in.SMInputCursor inputCursor)
Object import. |
protected void |
saveBambooObject(net.sf.hibernate.Session session,
BambooObject object)
Save object without regenerating the id if already assigned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.bamboo.migration.BambooStAXMappingHelper |
---|
getXmlRootNodeName |
Constructor Detail |
---|
protected BambooStAXMappingHelperAbstractImpl(net.sf.hibernate.SessionFactory sessionFactory)
Method Detail |
---|
protected void exportProperties(@NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull T object, @NotNull net.sf.hibernate.Session session) throws java.lang.Exception
outputElement
- the parent nodeobject
- object being exportedsession
- Hibernate session object
java.lang.Exception
- when something went wrongprotected final void exportXml(@NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull T object) throws java.lang.Exception
outputElement
- an element at which exported should create a node to export dataobject
- object being exported
java.lang.Exception
- when something went wrongpublic void exportXml(@NotNull net.sf.hibernate.Session session, @NotNull org.codehaus.staxmate.out.SMOutputElement outputElement, @NotNull T object) throws java.lang.Exception
exportXml
in interface BambooStAXMappingHelper<T>
session
- Hibernate session objectoutputElement
- an element at which exported should create a node to export dataobject
- object being exported
java.lang.Exception
- when something went wrong@NotNull protected abstract T createItemInstance(org.codehaus.staxmate.in.SMInputCursor inputCursor) throws java.lang.Exception
inputCursor
- input cursor that points to the parent node containing object properties
javax.xml.stream.XMLStreamException
- when something went wrong
java.lang.Exception
protected void importProperties(@NotNull T object, @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor, @NotNull net.sf.hibernate.Session session) throws java.lang.Exception
object
- object being importedinputCursor
- input cursor pointing to the child node of node that was passed to importXml methodsession
- Hibernate session object
java.lang.Exception
- when something went wrong@NotNull protected final T importXml(@NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor) throws java.lang.Exception
inputCursor
- input cursor that points to the parent node containing object properties
java.lang.Exception
- when something went wrong@NotNull public T importXml(@NotNull net.sf.hibernate.Session session, @NotNull org.codehaus.staxmate.in.SMInputCursor inputCursor) throws java.lang.Exception
importXml
in interface BambooStAXMappingHelper<T>
session
- Hibernate session objectinputCursor
- a cursor that points to the parent node containing object properties
java.lang.Exception
- when something went wrong@NotNull protected org.codehaus.staxmate.out.SMOutputElement createRootElement(@NotNull org.codehaus.staxmate.out.SMOutputElement outputElement) throws javax.xml.stream.XMLStreamException
outputElement
- parent node for the object's root node
javax.xml.stream.XMLStreamException
- when something went wrongprotected void commitClearSession(@NotNull net.sf.hibernate.Session session) throws net.sf.hibernate.HibernateException, java.sql.SQLException
session
- db session
net.sf.hibernate.HibernateException
- when session.flush() operation fails
java.sql.SQLException
- when session.connection().commit() operation failsprotected void commitSession(@NotNull net.sf.hibernate.Session session) throws net.sf.hibernate.HibernateException, java.sql.SQLException
session
- db session
net.sf.hibernate.HibernateException
- when session.flush() operation fails
java.sql.SQLException
- when session.connection().commit() operation failsprotected void saveBambooObject(@NotNull net.sf.hibernate.Session session, @NotNull BambooObject object) throws net.sf.hibernate.HibernateException
session
- Hibernate session objectobject
- object to be saved
net.sf.hibernate.HibernateException
- when save operation failedprotected net.sf.hibernate.Session getSession()
public net.sf.hibernate.SessionFactory getSessionFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |