예제 #1
0
 /**
  * createExisting( ObjectId )
  *
  * <p>Factory method creates a PersonalProfileDO object by searching for it in the database using
  * the passed ObjectID value as the primary key.
  *
  * @param id The ObjectId for the object.
  * @exception DataObjectException If the object is not found in the database.
  * @exception com.lutris.appserver.server.sql.ObjectIdException If an object id can't be allocated
  *     for this object.
  * @exception DatabaseManagerException If a connection to the database cannot be established, etc.
  * @exception SQLException If the database rejects the SQL generated to retrieve data for this
  *     object, or if the table contains a bad foreign key, etc.
  */
 protected static PersonalProfileDO createExisting(ObjectId id)
     throws SQLException, ObjectIdException, DataObjectException, DatabaseManagerException {
   if (null == id) return null;
   PersonalProfileDO ret = null;
   ret = new PersonalProfileDO(id);
   ret.setPersistent(true); // mark DO as persistent (preexisting)
   if (!false) // If not lazy-loading, fetch DO data now.
   ret.loadData();
   // unset the GenericDO.dirty flag.
   ret.markClean();
   return ret;
 }
예제 #2
0
 /**
  * Load the actual DO data if necessary. Called by get/set methods.
  *
  * @exception DataObjectException If a data access error occurs.
  */
 private void checkLoad() throws DataObjectException {
   if (null == data)
     try {
       loadData();
     } catch (Exception e) {
       throw new DataObjectException(
           "Unable to load data for PersonalProfileDO id="
               + getOId()
               + ", error = "
               + e.getMessage());
     }
 }