robotoworks / mechanoid

Eclipse plugin providing a set of DSL's for the rapid development of Android apps
58 stars 26 forks source link

subquery without argument #211

Closed hannesa2 closed 10 years ago

hannesa2 commented 10 years ago

It's impossible to add a subquery without argument. eg

 .append(" exists (select 1 from child where main_Id= 'main'._id)");

a probably workaround is not working. I don't know why

 .append(" exists (select 1 from child where main_Id= 'main'._id) and 1=?","1");

for the ordinary problem, this prevents it to add

public SQuery expr(SQuery query) {

    List<String> args = query.getArgs();

    if(args.size() > 0) { //<- here
        ensureOp();
        mBuilder.append("(").append(query).append(")");
        mArgs.addAll(args);
    }

    mNextOp = null;

    return this;
}

I tested it like this

public SQuery expr(SQuery query) {

    List<String> args = query.getArgs();

    ensureOp();
    mBuilder.append("(").append(query).append(")");

    if(args.size() > 0) {
        mArgs.addAll(args);
    }

    mNextOp = null;

    return this;
}

I would do the commit, if I have the required rights, but I'm not a collaborator

fluxtah commented 10 years ago

Hey sorry for the delay I will check it out when I get a moment