Esempio n. 1
0
 /**
  * Remove (delete) a CompanyBDO object whose CompanyDO refers to the DO held by this BDO.
  *
  * @param r CompanyBDO to be deleted.
  * @param tran The transaction to be used for the commit. If null, a new transaction is created.
  * @exception DatabaseManagerException if could not create a transaction
  * @exception java.sql.SQLException if any SQL errors occur.
  * @exception DataObjectException If object is not found in the database.
  */
 public void removeCompanyBDO(jobmatch.data.CompanyBDO rbdo, DBTransaction tran)
     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException,
         DBRowUpdateException, QueryException {
   IndustryDO rdo = rbdo.getIndustry();
   String rdoHandle = rdo.getHandle();
   String mydoHandle = DO.getHandle();
   if (null == rdoHandle || null == mydoHandle || (!rdoHandle.equals(mydoHandle))) {
     throw new DataObjectException(
         "Object " + rdo + " does not refer to object " + DO + ", cannot be removed this way.");
   }
   rbdo.delete(tran);
 }
Esempio n. 2
0
 /**
  * The methods <CODE>
  *     getHandle
  *     hasMatchingHandle
  * </CODE> are used by Presentation Objects that need to populate
  * HTML select lists with <CODE>IndustryBDO</CODE> objects as options.
  *
  * The <CODE>getHandle()</CODE> method is used
  * to set the value for each option,
  * and the <CODE>hasMatchingHandle()<CODE>
  * methods are used to lookup the Data Object when the selection has
  * been made.
  *
  * This IndustryBDO object holds a reference to a IndustryDO object.
  * The id of this IndustryBDO is the id of its IndustryDO.
  * @exception DatabaseManagerException
  *   If a connection to the database cannot be established, etc.
  * @return id of this BDO as a string
  *   If an object id can't be allocated for this object.
  */
 public String getHandle() throws DatabaseManagerException {
   return DO.getHandle();
 }