Package er.extensions.qualifiers

Examples of er.extensions.qualifiers.ERXKeyValueQualifier$PROPERTIES


   * @param key
   *            the key
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier isFalse(String key) {
    return new ERXKeyValueQualifier(key, ERXQ.EQ, Boolean.FALSE);
  }
View Full Code Here


   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier notEquals(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.NE, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier lessThan(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.LT, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier greaterThan(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.GT, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier lessThanOrEqualTo(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.LTEQ, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier greaterThanOrEqualTo(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.GTEQ, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier compare(String key, NSSelector operator, Object value) {
    return new ERXKeyValueQualifier(key, operator, value);
  }
View Full Code Here

   * @param value
   *            the value
   * @return an EOKeyValueQualifier
   */
  public static ERXKeyValueQualifier containsObject(String key, Object value) {
    return new ERXKeyValueQualifier(key, ERXQ.CONTAINS, value);
  }
View Full Code Here

   * Useful for clearing the database before a unit test.
   */
  public static void deleteAllObjects() {
    EOEditingContext ec = ERXEC.newEditingContext();
    // Hacky way to qualify all objects in any entity in ERXTest, assuming pk is always "id"
    EOQualifier q = new ERXKeyValueQualifier("id", EOQualifier.QualifierOperatorNotEqual, Integer.valueOf(-1));
    ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, Company.ENTITY_NAME, q);
    ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, Employee.ENTITY_NAME, q);
    ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, Paycheck.ENTITY_NAME, q);
    ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, Role.ENTITY_NAME, q);
   
    // Join table hacky delete
    q = new ERXKeyValueQualifier("roleId", EOQualifier.QualifierOperatorNotEqual, Integer.valueOf(-1));
    ERXEOAccessUtilities.deleteRowsDescribedByQualifier(ec, "EmployeeRole", q);
  }
View Full Code Here

  }

 
  public static String loadWithNewPattern(S3 s3,RefInteger storage, String path) {
    PageContext pc = ThreadLocalPageContext.get();
    Properties prop=null;
    if(pc!=null){
      prop=pc.getApplicationContext().getS3();
    }
    if(prop==null) prop=new PropertiesImpl();
   
    int defaultLocation = prop.getDefaultLocation();
    storage.setValue(defaultLocation);
    String accessKeyId = prop.getAccessKeyId();
    String secretAccessKey = prop.getSecretAccessKey();
   
    int atIndex=path.indexOf('@');
    int slashIndex=path.indexOf('/');
    if(slashIndex==-1){
      slashIndex=path.length();
      path+="/";
    }
    int index;
   
    // key/id
    if(atIndex!=-1) {
      index=path.indexOf(':');
      if(index!=-1 && index<atIndex) {
        accessKeyId=path.substring(0,index);
        secretAccessKey=path.substring(index+1,atIndex);
        index=secretAccessKey.indexOf(':');
        if(index!=-1) {
          String strStorage=secretAccessKey.substring(index+1).trim().toLowerCase();
          secretAccessKey=secretAccessKey.substring(0,index);
          //print.out("storage:"+strStorage);
          storage.setValue(S3.toIntStorage(strStorage, defaultLocation));
        }
      }
      else accessKeyId=path.substring(0,atIndex);
    }
    path=prettifyPath(path.substring(atIndex+1));
    index=path.indexOf('/');
    s3.setHost(prop.getHost());
    if(index==-1){
      if(path.equalsIgnoreCase(S3Constants.HOST) || path.equalsIgnoreCase(prop.getHost())){
        s3.setHost(path);
        path="/";
      }
    }
    else {
      String host=path.substring(0,index);
      if(host.equalsIgnoreCase(S3Constants.HOST) || host.equalsIgnoreCase(prop.getHost())){
        s3.setHost(host);
        path=path.substring(index);
      }
    }
   
View Full Code Here

TOP

Related Classes of er.extensions.qualifiers.ERXKeyValueQualifier$PROPERTIES

Copyright © 2018 www.massapicom. 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.