Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.mysema.query.jdoql;
 
 
Abstract superclass for SubQuery implementations

Parameters:
<Q>
Author(s):
tiwe
public class AbstractJDOQLSubQuery<Q extends AbstractJDOQLSubQuery<Q>> extends DetachableQuery<Q>{

    
    public AbstractJDOQLSubQuery() {
        this(new DefaultQueryMetadata());
    }

    

Parameters:
metadata
    @SuppressWarnings("unchecked")
    public AbstractJDOQLSubQuery(QueryMetadata metadata) {
        super(new QueryMixin<Q>(metadata));
        this..setSelf((Q)this);
    }
    public Q from(PEntity<?>... args) {
        return .from(args);
    }
    @SuppressWarnings("unchecked")
    public <P> Q from(Path<? extends Collection<P>> targetPEntity<P> alias){
        .getMetadata().addJoin(., OSimple.create(alias.getType(), .target.asExpr(), alias));
        return (Q)this;
    }
    @Override
    public String toString(){
        if (!.getMetadata().getJoins().isEmpty()){
            Expr<?> source = .getMetadata().getJoins().get(0).getTarget();
            JDOQLSerializer serializer = new JDOQLSerializer(.source);
            serializer.serialize(.getMetadata(), falsefalse);
            return serializer.toString().trim();
        }else{
            return super.toString();
        }
    }
New to GrepCode? Check out our FAQ X