Examples of DBSubset


Examples of com.knowgate.dataobjs.DBSubset

   * @since 4.0
   */
  public static DBSubset getAddressesByCompanyName(JDCConnection oConn, String sCompanyNm, String sWorkArea)
    throws SQLException {
    String sRetVal;
    DBSubset oDbs = new DBSubset(DB.k_addresses,new Address().getTable(oConn).getColumnsStr(),
                   DB.nm_company+"=? AND "+DB.gu_workarea+"=?",
                                 10);
  oDbs.load(oConn, new Object[]{sCompanyNm,sWorkArea});
 
  return oDbs;
  } // getAddressesByCompanyName
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

    if (DebugFile.trace) {
      DebugFile.writeln("Begin Categories.getRoots([Connection])");
      DebugFile.incIdent();
    }

    oRoots = new DBSubset(DB.k_cat_root,DB.gu_category,"",10);
    iRootsCount = oRoots.load (oConn);

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End Categories.getRoots()");
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

    if (!oRootsLoaded) {
      Object[] aLang = { sLanguage };

      if (iOrderBy>0)
        oRootsNamed = new DBSubset (sRootsNamedTables, sRootsNamedFields, sRootsNamedFilter + " ORDER BY " + iOrderBy, 16);
      else
        oRootsNamed = new DBSubset (sRootsNamedTables, sRootsNamedFields, sRootsNamedFilter, 16);

      iRootsCount = oRootsNamed.load(oConn, aLang);
      oRootsLoaded = true;
    }
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

      DebugFile.writeln("Begin Categories.getChildsNamed([Connection], " + (idParent==null ? "null" : idParent) + "," + (sLanguage==null ? "null" : sLanguage) + "," + String.valueOf(iOrderBy) + ")");
      DebugFile.incIdent();
    }

    Object[] aParams = { idParent, sLanguage, idParent, idParent, sLanguage };
    DBSubset oChilds;

    if (iOrderBy>0)
      oChilds = new DBSubset (sChildNamedTables, sChildNamedFields, sChildNamedFilter +
                              " UNION SELECT " +
                              "c." + DB.gu_category + ",c." + DB.nm_category + ",c." + DB.nm_category + "," +
                              "c." + DB.nm_icon + ",c." + DB.nm_icon2 + " FROM " + DB.k_categories + " c, " +
                              DB.k_cat_tree + " t WHERE c." + DB.gu_category + "=t." + DB.gu_child_cat + " AND " +
                              "t." + DB.gu_parent_cat + "=? AND c." +  DB.gu_category + " NOT IN " +
                              "(SELECT " + DB.gu_category + " FROM " + sChildNamedTables + " WHERE " + sChildNamedFilter + ") ORDER BY " + iOrderBy, 32);
    else
      oChilds = new DBSubset (sChildNamedTables, sChildNamedFields, sChildNamedFilter +
                              " UNION SELECT " +
                              "c." + DB.gu_category + ",c." + DB.nm_category + ",c." + DB.nm_category + ", " +
                              "c." + DB.nm_icon + ",c." + DB.nm_icon2 + " FROM " + DB.k_categories + " c, " +
                              DB.k_cat_tree + " t WHERE c." + DB.gu_category + "=t." + DB.gu_child_cat + " AND " +
                              "t." + DB.gu_parent_cat + "=? AND c." +  DB.gu_category + " NOT IN " +
                              "(SELECT " + DB.gu_category + " FROM " + sChildNamedTables + " WHERE " + sChildNamedFilter + ")", 32);

    int iChilds = oChilds.load(oConn, aParams);

    if (DebugFile.trace) {
      DebugFile.writeln(String.valueOf(iChilds) + " childs readed in " + String.valueOf(System.currentTimeMillis()-lElapsed) + " ms");
      DebugFile.decIdent();
      DebugFile.writeln("End Categories.getChildsNamed()");
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

      DebugFile.writeln("Begin NewsGroup.subscribers ([Connection])");
      DebugFile.incIdent();
      DebugFile.writeln("gu_newsgrp=" + getStringNull(DB.gu_newsgrp, "null"));
    }

    DBSubset oSubs = new DBSubset (DB.k_newsgroup_subscriptions,
                                   DB.gu_user + "," + DB.tx_email + "," + DB.id_msg_type + "," + DB.tp_subscrip,
                                   DB.gu_newsgrp + "=? AND " + DB.id_status + "=" + String.valueOf(Subscription.ACTIVE), 100);

    oSubs.load(oConn, new Object[] {getString(DB.gu_newsgrp)});

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End NewsGroup.subscribers() : " + String.valueOf(oSubs.getRowCount()));
    }

    return oSubs;
  } // subscribers
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

  if (nMaxMsgs<=0) throw new IllegalArgumentException("NewsGroup.getTopLevelMessages() The number of messages to get must be greater than zero");
  if (isNull(DB.gu_category)) throw new IllegalStateException("NewsGroup.getTopLevelMessages() Cannot get most voted messages for a NewsGroup than as not been previously loaded");
  if (null==sOrderBy) sOrderBy = DB.dt_published;
    if (sOrderBy.length()==0) sOrderBy = DB.dt_published;

  DBSubset oDbss = new DBSubset(DB.k_newsmsgs + " m," + DB.k_x_cat_objs +" g",
      "m."+DB.gu_msg+",m."+DB.nm_author+",m."+DB.gu_writer+",m."+DB.dt_published+",m."+DB.dt_start+",m."+DB.id_language+",m."+DB.id_status+",m."+DB.id_msg_type+",m."+DB.nu_thread_msgs+",m."+DB.gu_thread_msg+",m."+DB.nu_votes+",m."+DB.tx_email+",m."+DB.tx_subject+",m."+DB.dt_expire+",m."+DB.dt_validated+",m."+DB.gu_validator+",m."+DB.gu_product+",m."+DB.tx_msg,
      "g."+DB.gu_category+"=? AND g."+DB.id_class+"="+String.valueOf(NewsMessage.ClassId)+" AND g."+DB.gu_object+"=m."+DB.gu_msg+" AND "+
      "m."+DB.gu_parent_msg + " IS NULL ORDER BY "+sOrderBy+" DESC",nMaxMsgs);

  oDbss.setMaxRows(nMaxMsgs);

  oDbss.load(oConn, new Object[]{getString(DB.gu_category)});
 
  return oDbss;
  } // getTopLevelMessages
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

   * @return DBSubset with the following columns<br>
   * <table><tr><td>id_fare</td><td>pr_sale</td><td>id_currency</td>pct_tax_rate</td><td>is_tax_included</td><td>dt_start</td><td>dt_end</td><td>tp_fare</td></tr></table>
   * @throws SQLException
   */
  public DBSubset getFares(JDCConnection oConn) throws SQLException {
    DBSubset oFares = new DBSubset(DB.k_prod_fares,DB.id_fare+","+DB.pr_sale+","+
                                   DB.id_currency+","+DB.pct_tax_rate+","+
                                   DB.is_tax_included+","+DB.dt_start+","+DB.dt_end+","+
                                   DB.tp_fare,DB.gu_product+"=?", 10);
    oFares.load(oConn, new Object[]{getStringNull(DB.gu_product,null)});

    return oFares;
  }
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

   * @return DBSubset with the following columns<br>
   * <table><tr><td>id_fare</td><td>pr_sale</td><td>id_currency</td>pct_tax_rate</td><td>is_tax_included</td><td>dt_start</td><td>dt_end</td><td>tp_fare</td></tr></table>
   * @throws SQLException
   */
  public DBSubset getFaresOfType(JDCConnection oConn, String sType) throws SQLException {
    DBSubset oFares = new DBSubset(DB.k_prod_fares,DB.id_fare+","+DB.pr_sale+","+
                                   DB.id_currency+","+DB.pct_tax_rate+","+
                                   DB.is_tax_included+","+DB.dt_start+","+DB.dt_end+","+
                                   DB.tp_fare,DB.gu_product+"=? AND "+DB.tp_fare+"=?", 10);
    oFares.load(oConn, new Object[]{getStringNull(DB.gu_product,null),sType});
    return oFares;
  }
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

   * @return DBSubset with the following columns<br>
   * <table><tr><td>id_fare</td><td>pr_sale</td><td>id_currency</td>pct_tax_rate</td><td>is_tax_included</td><td>dt_start</td><td>dt_end</td><td>tp_fare</td></tr></table>
   * @throws SQLException
   */
  public DBSubset getFaresOfType(JDCConnection oConn, String sType, Date dtWhen) throws SQLException {
    DBSubset oFares = new DBSubset(DB.k_prod_fares,DB.id_fare+","+DB.pr_sale+","+
                                   DB.id_currency+","+DB.pct_tax_rate+","+
                                   DB.is_tax_included+","+DB.dt_start+","+DB.dt_end+","+
                                   DB.tp_fare,DB.gu_product+"=? AND "+DB.tp_fare+"=? AND "+
                                   "("+DB.dt_start+" IS NULL OR "+DB.dt_start+"<=?) AND "+
                                   "("+DB.dt_end+" IS NULL OR "+DB.dt_end+">=?)", 10);
    oFares.load(oConn, new Object[]{getStringNull(DB.gu_product,null),sType,dtWhen,dtWhen});
    return oFares;
  }
View Full Code Here

Examples of com.knowgate.dataobjs.DBSubset

    int iLoca;
    Image oImg = new Image();
    Object aProd[] = { get(DB.gu_product) };

    oLocations = new DBSubset (DB.k_images, oImg.getTable(oConn).getColumnsStr(), DB.gu_product + "=?", 10);
    iLoca = oLocations.load (oConn, aProd);

    oImg = null;

    if (DebugFile.trace) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.