code: public String getStatement()
      {
          if(sql == null)
          {
              StringBuffer stmt = new StringBuffer(128);
              ClassDescriptor cld = getClassDescriptor();
  
              FieldDescriptor[] fieldDescriptors = cld.getPkFields();
              if(fieldDescriptors == null || fieldDescriptors.length == 0)
              {
                  throw new OJBRuntimeException("No PK fields defined in metadata for " + cld.getClassNameOfObject());
              }
              FieldDescriptor field = fieldDescriptors[0];
  
              stmt.append(SELECT);
              stmt.append(field.getColumnName());
              stmt.append(FROM);
              stmt.append(cld.getFullTableName());
              appendWhereClause(cld, false, stmt);
  
              sql = stmt.toString();
          }
          return sql;
      }
docs: Return SELECT clause for object existence call