gov.nih.nci.caarray.services.mageloader
Class MAGEMLImportManagerDB

java.lang.Object
  extended by gov.nih.nci.caarray.services.util.db.ManagerDB
      extended by gov.nih.nci.caarray.services.mageloader.MAGEMLImportManagerDB

public class MAGEMLImportManagerDB
extends ManagerDB

Specialized ManagerDB for MAGEML import shared.

Author:
gustafsons, tranp
See Also:
MAGEMLImportManagerDB

Field Summary
protected static org.apache.log4j.Logger logger_
          Logger used by this class.
 
Fields inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB
CASCADE_LINK, CASCADE_NONE, CASCADE_OBJECT, ID_UNSET
 
Constructor Summary
MAGEMLImportManagerDB()
          Default Constructor
 
Method Summary
 Identifiable getByIdentifier(java.lang.Class identifiableClass, java.lang.String identifier, boolean insertIfNotFound)
          Get object by identifier, if not there it makes it when insertIfNotFound is true.
 java.lang.Object getObject(org.apache.ojb.broker.query.Query query)
          This method will return a single object that matches the specified query.
 java.lang.Object[] getObjects(org.apache.ojb.broker.query.Query query)
          This method will return a collection of objects that meets the specified query.
 java.lang.String getOwner()
           
 org.apache.ojb.broker.PersistenceBroker getPersistenceBroker()
          Gets a PersistenceBroker from the pool for the default profile.
 ProtectionGroupData[] getProtectionGroups()
           
 org.apache.ojb.broker.Identity insertObject(java.lang.Object obj)
          Inserts an object.
 org.apache.ojb.broker.Identity insertObject(java.lang.Object obj, boolean applyTransaction)
          Inserts an object.
protected  org.apache.ojb.broker.Identity insertObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker, boolean applyTransaction)
          Inserts an object.
 void link(java.lang.Object object, java.lang.String attributeName, boolean insert)
           
 OntologyEntry matchOntologyEntry(OntologyEntry entry)
           
 void putObjectInCache(java.lang.Object object)
           
 Identifiable resolveIdentifiable(org.xml.sax.Attributes attrs, Identifiable parsedIdentifiable)
          Get object by identifier, if not there it makes it.
 void runDeleteStatements(java.lang.String tag, java.lang.Object parent)
          Runs delete statements for owned objects
 void setOwner(java.lang.String owner)
           
 void setProtectionGroups(ProtectionGroupData[] protectionGroups)
           
 boolean updateObject(java.lang.Object obj)
          Updates an object.
 boolean updateObject(java.lang.Object obj, boolean applyTransaction)
           
protected  boolean updateObject(java.lang.Object obj, org.apache.ojb.broker.PersistenceBroker broker)
          Updates an object.
 
Methods inherited from class gov.nih.nci.caarray.services.util.db.ManagerDB
clearCache, close, countObjects, countObjects, deleteByQuery, deleteMtoNRelation, deleteObject, deleteObject, deleteObject, deleteObjectByQuery, exists, getIdentifiable, getObject, getObject, getObject, getObject, getObject, getObjectIterator, getObjectIterator, getObjects, getObjects, getSqlInLimit, insertMtoNRelation, insertMtoNRelation, insertObject, link, removeFromCache, retrieveReference, retrieveReferences, setCascadeDelete, setCascadeRetrieve, setCascadeStore, storeObject, storeObject, unlink, unlink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger_

protected static org.apache.log4j.Logger logger_
Logger used by this class.

Constructor Detail

MAGEMLImportManagerDB

public MAGEMLImportManagerDB()
Default Constructor

Method Detail

runDeleteStatements

public void runDeleteStatements(java.lang.String tag,
                                java.lang.Object parent)
Runs delete statements for owned objects

Parameters:
tag -
parent -

getObject

public java.lang.Object getObject(org.apache.ojb.broker.query.Query query)
                           throws java.lang.Exception
This method will return a single object that matches the specified query.

Overrides:
getObject in class ManagerDB
Parameters:
The - query to include any criteria for searching an object of a specific class.
Throws:
java.lang.Exception

getObjects

public java.lang.Object[] getObjects(org.apache.ojb.broker.query.Query query)
                              throws java.lang.Exception
This method will return a collection of objects that meets the specified query.

Overrides:
getObjects in class ManagerDB
Parameters:
query - - The query to include any criteria for searching objects of a specific class as a collection
Throws:
java.lang.Exception

updateObject

public boolean updateObject(java.lang.Object obj)
Updates an object.

Overrides:
updateObject in class ManagerDB
Parameters:
obj - - The object to be updated
Returns:
- True if the passed object was updated; false otherwise.

updateObject

public boolean updateObject(java.lang.Object obj,
                            boolean applyTransaction)

updateObject

protected boolean updateObject(java.lang.Object obj,
                               org.apache.ojb.broker.PersistenceBroker broker)
Updates an object.

Overrides:
updateObject in class ManagerDB
Parameters:
obj - - The object to be updated
Returns:
- True if the passed object was updated; false otherwise.

putObjectInCache

public void putObjectInCache(java.lang.Object object)

getByIdentifier

public Identifiable getByIdentifier(java.lang.Class identifiableClass,
                                    java.lang.String identifier,
                                    boolean insertIfNotFound)
                             throws java.lang.Exception
Get object by identifier, if not there it makes it when insertIfNotFound is true.

Parameters:
identifiableClass -
identifier -
insertIfNotFound -
Returns:
the Identifiable
Throws:
ImportException
java.lang.Exception

resolveIdentifiable

public Identifiable resolveIdentifiable(org.xml.sax.Attributes attrs,
                                        Identifiable parsedIdentifiable)
                                 throws java.lang.Exception
Get object by identifier, if not there it makes it.

Parameters:
attrs - - The parsed Identifiable element's attributes extracted from MAGE-ML used to update the same Identifiable if resolved from cache or database.
parsedIdentifiable - - The Identifiable object parsed from MAGE-ML.
Returns:
The resolved Identifiable
Throws:
ImportException
java.lang.Exception

matchOntologyEntry

public OntologyEntry matchOntologyEntry(OntologyEntry entry)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

insertObject

public org.apache.ojb.broker.Identity insertObject(java.lang.Object obj)
                                            throws java.lang.Exception
Inserts an object.

Overrides:
insertObject in class ManagerDB
Parameters:
obj - - The object to be inserted
Returns:
- An Identity object that represents the primary key of the stored object. If the passed object is null, null is returned.
Throws:
java.lang.Exception

insertObject

public org.apache.ojb.broker.Identity insertObject(java.lang.Object obj,
                                                   boolean applyTransaction)
                                            throws java.lang.Exception
Inserts an object.

Parameters:
obj - - The object to be inserted
Throws:
java.lang.Exception

insertObject

protected org.apache.ojb.broker.Identity insertObject(java.lang.Object obj,
                                                      org.apache.ojb.broker.PersistenceBroker broker,
                                                      boolean applyTransaction)
                                               throws java.lang.Exception
Inserts an object.

Parameters:
obj - - The object to be inserted
Returns:
- IMPORTANT: Always null for efficiency as the client code is not concerned with the returning primary key.
Throws:
java.lang.Exception

link

public void link(java.lang.Object object,
                 java.lang.String attributeName,
                 boolean insert)
Overrides:
link in class ManagerDB

getOwner

public java.lang.String getOwner()
Returns:
Returns the owner.

setOwner

public void setOwner(java.lang.String owner)
Parameters:
owner - The owner to set.

getProtectionGroups

public ProtectionGroupData[] getProtectionGroups()
Returns:
Returns the protectionGroups.

setProtectionGroups

public void setProtectionGroups(ProtectionGroupData[] protectionGroups)
Parameters:
protectionGroups - The protectionGroups to set.

getPersistenceBroker

public org.apache.ojb.broker.PersistenceBroker getPersistenceBroker()
Description copied from class: ManagerDB
Gets a PersistenceBroker from the pool for the default profile.

Overrides:
getPersistenceBroker in class ManagerDB
Returns:
A PersistenceBroker instance.