Esempio n. 1
0
 public String toString(int indentCount) {
   String indent = "";
   for (int i = 0; i < indentCount; i++) {
     indent += ". ";
   }
   String str = indent + "PersonalProfileDO:";
   ObjectId oid = getOId();
   String id = "virgin";
   if (null != oid) id = oid.toString();
   str += " OID=" + id;
   if (null != data)
     str =
         str
             + "\n"
             + indent
             + "MinAge="
             + data.MinAge
             + "\n"
             + indent
             + "MaxAge="
             + data.MaxAge
             + "\n"
             + indent
             + "Nationality="
             + (null == data.Nationality ? null : data.Nationality.toString(indentCount + 1))
             + "\n"
             + indent
             + "Sex="
             + data.Sex;
   return str + "\n" + indent + "SUPER=" + super.toString(indentCount);
   // return str;
 }
Esempio n. 2
0
 public String toString(int indentCount) {
   String indent = "";
   for (int i = 0; i < indentCount; i++) {
     indent += ". ";
   }
   String str = indent + "TreeLeafDO:";
   ObjectId oid = getOId();
   String id = "virgin";
   if (null != oid) id = oid.toString();
   str += " OID=" + id;
   if (null != data)
     str =
         str
             + "\n"
             + indent
             + "LeafNumber="
             + data.LeafNumber
             + "\n"
             + indent
             + "Profile="
             + (null == data.Profile ? null : data.Profile.toString(indentCount + 1))
             + "\n"
             + indent
             + "Mandatory="
             + data.Mandatory;
   return str + "\n" + indent + "SUPER=" + super.toString(indentCount);
   // return str;
 }
  /**
   * Set the OID to query. WARNING! This method assumes that table <CODE>SoftwareCandidate</CODE>
   * has a column named <CODE>"oid"</CODE>. This method is called from the DO classes to retrieve an
   * object by id.
   *
   * @param oid The object id to query.
   */
  public void setQueryOId(ObjectId oid) {
    // Remove from cacheHits any DOs that do not meet this
    // setQuery requirement.
    if (null == oid) return;
    requireUniqueInstance();
    for (int i = 0; i < cacheHits.size(); i++) {
      SoftwareCandidateDO DO = (SoftwareCandidateDO) cacheHits.elementAt(i);
      if (null == DO) continue;
      boolean equals = true;
      ObjectId id = DO.getOId();
      if (null == id || !id.equals(oid)) cacheHits.removeElementAt(i--);
    }

    // Also prepare the SQL needed to query the database
    // in case there is no cache, or the query involves other tables.
    builder.addWhereClause("oid", oid.toBigDecimal(), QueryBuilder.NOT_NULL);
  }