dbXML API

com.dbxml.db.common.adapters
Class JAXBElementAdapter

java.lang.Object
  extended bycom.dbxml.db.core.adapter.SimpleAdapter
      extended bycom.dbxml.db.common.adapters.JAXBElementAdapter
All Implemented Interfaces:
Adapter

public final class JAXBElementAdapter
extends SimpleAdapter

JAXElementAdapter adapts a dbXML Collection to support the management of JAXB-bound Java classes.


Constructor Summary
JAXBElementAdapter(Collection col)
           
 
Method Summary
 javax.xml.bind.Element getObject(Transaction tx, java.lang.Object key)
          getObject instantiates and returns a JAXB Element object based on the provided Key.
 Key insertObject(Transaction tx, javax.xml.bind.Element obj)
          insertObject inserts an JAXB Element object into the Collection and returns a newly generated Key.
 void insertObject(Transaction tx, java.lang.Object key, javax.xml.bind.Element obj)
          insertObject inserts an JAXB Element object into the Collection based on the specified Key.
 void setObject(Transaction tx, java.lang.Object key, javax.xml.bind.Element obj)
          setObject sets an JAXB Element object in the Collection based on the provided Key.
 
Methods inherited from class com.dbxml.db.core.adapter.SimpleAdapter
getCanonicalName, getCollection, getKeyCount, getName, listKeys, queryCollection, queryDocument, remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBElementAdapter

public JAXBElementAdapter(Collection col)
Method Detail

setObject

public void setObject(Transaction tx,
                      java.lang.Object key,
                      javax.xml.bind.Element obj)
               throws DBException
setObject sets an JAXB Element object in the Collection based on the provided Key. dbXML takes care of associating the implementation class with the JAXB Element object.

Parameters:
tx - The controlling Transaction
key - The Key to use
obj - The Object to set
Throws:
DBException - If a Database Exception occurs

insertObject

public Key insertObject(Transaction tx,
                        javax.xml.bind.Element obj)
                 throws DBException
insertObject inserts an JAXB Element object into the Collection and returns a newly generated Key. dbXML takes care of associating the implementation class with the JAXB Element object.

Parameters:
tx - The controlling Transaction
obj - The Object to insert
Returns:
The new Object Identifier
Throws:
DBException - If a Database Exception occurs

insertObject

public void insertObject(Transaction tx,
                         java.lang.Object key,
                         javax.xml.bind.Element obj)
                  throws DBException
insertObject inserts an JAXB Element object into the Collection based on the specified Key. dbXML takes care of associating the implementation class with the JAXB Element object.

Parameters:
tx - The controlling Transaction
key - The Key to use
obj - The Object to insert
Throws:
DBException - If a Database Exception occurs

getObject

public javax.xml.bind.Element getObject(Transaction tx,
                                        java.lang.Object key)
                                 throws DBException
getObject instantiates and returns a JAXB Element object based on the provided Key. dbXML takes care of instantiating the correct class, but only if a class was registered with the Document in the first place.

Parameters:
tx - The controlling Transaction
key - The Document Key
Returns:
an Castable JAXB Element Instance
Throws:
DBException - If a Database Exception occurs

dbXML API

Copyright (c) 2004 The dbXML Group