Package com.jengine.orm.db.query

Examples of com.jengine.orm.db.query.SQLQuery$Group


           ((CanonicalUser)grantee).setDisplayName("TODO");
           grants[i].setGrantee(grantee);
           break;
         
        case SAcl.GRANTEE_ALLUSERS:
           grantee = new Group();
           ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/AllUsers" );
           grants[i].setGrantee(grantee);
             break;
            
        case SAcl.GRANTEE_AUTHENTICATED:       
           grantee = new Group();
           ((Group)grantee).setURI( "http://acs.amazonaws.com/groups/global/Authenticated" );
           grants[i].setGrantee(grantee);
           break;
         
        default :
View Full Code Here


          engineGrant.setGrantee(SAcl.GRANTEE_USER);
          engineGrant.setCanonicalUserID(((CanonicalUser)grantee).getID());
        }
        else if (grantee instanceof Group)
        {
           Group temp = (Group)grantee;
           String uri = temp.getURI();
           if ( uri.equalsIgnoreCase( "http://acs.amazonaws.com/groups/global/AllUsers" )) {
              // -> this allows all public unauthenticated access based on permission given
              engineGrant.setGrantee(SAcl.GRANTEE_ALLUSERS);
              engineGrant.setCanonicalUserID( "*" );
           }
View Full Code Here

    public long count() throws DBException {
        return this.target(new Count()).<Long>one();
    }

    public <T extends Object> List<T> list() throws DBException {
        SQLQuery sqlQuery = toSQL();
        List result = manager.getModelClass().getProvider().select(sqlQuery);
        return processResult(result);
    }
View Full Code Here

    public void remove() throws DBException {
        manager.getModelClass().getProvider().remove(toSQL());
    }

    public SQLQuery toSQL() {
        SQLQuery query = new SQLQuery(multiModel.getMultiTable());

        if (targets.size() > 0) {
            for (Target target : targets.values()) {
                target.setSQL(query);
            }
        } else {
            defaultTarget.setSQL(query);
        }
        query.setDistinct(distinct);
        for (Filter filter : filters) {
            filter.setSQL(query);
        }
        for (StringFilter stringFilter : stringFilters) {
            stringFilter.setSQL(query);
        }
        for (MultiModelField field : group.values()) {
            query.group(field.getSQLName());
        }
        for (OrderItem orderItem : orderList) {
            orderItem.setSQL(query);
        }
        for (String fieldName : values.keySet()) {
            Field field = manager.getField(fieldName);
            query.addValue(field.getColumnName(), values.get(fieldName));
        }
        if (page.get("start") != null && page.get("end") != null) {
            query.setStart(page.get("start"));
            query.setEnd(page.get("end"));
            query.addParam(page.get("start"));
            query.addParam(page.get("end"));
        }

        return query;
    }
View Full Code Here

    public ClusterQuery page(Integer start, Integer end) {
        return (ClusterQuery) super.page(start, end);
    }

    public <T extends Object> List<T> list() throws DBException {
        SQLQuery sqlQuery = toSQL();
        List result = multiModel.getDB().getProvider().select(sqlQuery);
        return processResult(result);
    }
View Full Code Here

        List result = multiModel.getDB().getProvider().select(sqlQuery);
        return processResult(result);
    }

    public SQLQuery toSQL() {
        SQLQuery query = new SQLQuery(multiModel.getMultiTable());

        for (Target target : targets.values()) {
            target.setSQL(query);
        }
        query.setDistinct(distinct);
        for (Filter filter : filters) {
            filter.setSQL(query);
        }
        for (StringFilter stringFilter : stringFilters) {
            stringFilter.setSQL(query);
        }
        for (MultiModelField field : group.values()) {
            query.group(field.getSQLName());
        }
        for (OrderItem orderItem : orderList) {
            orderItem.setSQL(query);
        }
        for (String fieldName : values.keySet()) {
            MultiModelField field = multiModel.getFields().get(fieldName);
            query.addValue(field.getSQLName(), values.get(fieldName));
        }
        if (page.get("start") != null && page.get("end") != null) {
            query.setStart(page.get("start"));
            query.setEnd(page.get("end"));
            query.addParam(page.get("start"));
            query.addParam(page.get("end"));
        }

        return query;
    }
View Full Code Here

    Option outputOpt = obuilder.withLongName("output").withRequired(true).withArgument(
      abuilder.withName("output").withMinimum(1).withMaximum(1).create()).withDescription(
      "The output directory").withShortName("o").create();
   
   
    Group group = gbuilder.withName("Options").withOption(helpOpt).withOption(
        inputDirOpt).withOption(outputOpt).create();
   
    //.withOption(gramSizeOpt).withOption(typeOpt)
   
    try {
View Full Code Here

   
    Option modelOpt = obuilder.withLongName("model").withRequired(true).withArgument(
      abuilder.withName("index").withMinimum(1).withMaximum(1).create()).withDescription(
      "The directory containing the index model").withShortName("m").create();

    Group group = gbuilder.withName("Options").withOption(helpOpt)
        .withOption(inputDirOpt).withOption(modelOpt).create();
   
    try {
      Parser parser = new Parser();
     
View Full Code Here

   
    Option typeOpt = obuilder.withLongName("classifierType").withRequired(false).withArgument(
      abuilder.withName("classifierType").withMinimum(1).withMaximum(1).create()).withDescription(
      "Type of classifier: knn|tfidf. Default: bayes").withShortName("type").create();
   
    Group group = gbuilder.withName("Options").withOption(gramSizeOpt).withOption(helpOpt).withOption(
        inputDirOpt).withOption(modelOpt).withOption(typeOpt).withOption(contentFieldOpt)
        .withOption(categoryFieldOpt).withOption(maxResultsOpt)
        .create();
   
    try {
View Full Code Here

   
    Option helpOpt = obuilder.withLongName("help")
      .withDescription("Print out help")
      .withShortName("h").create();
   
    Group group = gbuilder.withName("Options")
      .withOption(inputOpt)
      .withOption(categoryOpt)
      .withOption(outputOpt)
      .withOption(categoryFieldsOpt)
      .withOption(textFieldsOpt)
View Full Code Here

TOP

Related Classes of com.jengine.orm.db.query.SQLQuery$Group

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.