Package freedb

Source Code of freedb.POQQuery1AND

package freedb;

import org.odbms.FUNCTION;
import org.odbms.OP;
import org.odbms.ObjectContainer;
import org.odbms.ObjectSet;
import org.odbms.Query;

import de.linwave.gtm.GTM;
import de.linwave.gtm.Util;

/**
*
* @author ljoeckel
*
*/
public class POQQuery1AND
{
  protected static ObjectContainer gtm = GTM.getInstance();

  /**
   *
   */
  public POQQuery1AND() {
    Query q1 = gtm.query(Disc.class);
    q1.constrain("DTITLE", OP.STARTS_WITH, FUNCTION.TO_UPPER, "ERIC CLAPTON");
    q1.constrain("DYEAR", OP.RANGE, 1990, 1999);

    Query q2 = gtm.query(Disc.class);
    q2.constrain("DGENRE", OP.EQUALS, FUNCTION.TO_UPPER, "Blues");
    q2.constrain("DTITLE", OP.CONTAINS, FUNCTION.TO_UPPER, "Live");

    ObjectSet<Disc> discs = q1.AND(q2);

    Util.printObjectSet(discs);

    q1.printConstraintInfo();
    q2.printConstraintInfo();
    gtm.printCacheStatistics();
  }

  /**
   *
   * @param args
   */
  public static void main(String[] args)
  {
    new POQQuery1AND();
  }
}
TOP

Related Classes of freedb.POQQuery1AND

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.