All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mysema.query.support.DetachableAdapter Maven / Gradle / Ivy

There is a newer version: 3.7.4
Show newest version
/*
 * Copyright 2011, Mysema Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mysema.query.support;

import javax.annotation.Nullable;

import com.mysema.query.Detachable;
import com.mysema.query.Tuple;
import com.mysema.query.types.Expression;
import com.mysema.query.types.Predicate;
import com.mysema.query.types.expr.BooleanExpression;
import com.mysema.query.types.expr.ComparableExpression;
import com.mysema.query.types.expr.DateExpression;
import com.mysema.query.types.expr.DateTimeExpression;
import com.mysema.query.types.expr.NumberExpression;
import com.mysema.query.types.expr.StringExpression;
import com.mysema.query.types.expr.TimeExpression;
import com.mysema.query.types.query.BooleanSubQuery;
import com.mysema.query.types.query.ComparableSubQuery;
import com.mysema.query.types.query.DateSubQuery;
import com.mysema.query.types.query.DateTimeSubQuery;
import com.mysema.query.types.query.ListSubQuery;
import com.mysema.query.types.query.NumberSubQuery;
import com.mysema.query.types.query.SimpleSubQuery;
import com.mysema.query.types.query.StringSubQuery;
import com.mysema.query.types.query.TimeSubQuery;

/**
 * DetachableAdapter is an apadater implementation for the Detachable interface
 * 
 * @author tiwe
 *
 */
public class DetachableAdapter implements Detachable{

    @Nullable
    private Detachable detachable;

    public DetachableAdapter() {}
    
    public DetachableAdapter(Detachable detachable) {
        this.detachable = detachable;
    }
    
    public NumberSubQuery count() {
        return detachable.count();
    }

    public BooleanExpression exists() {
        return detachable.exists();
    }

    public Detachable getDetachable() {
        return detachable;
    }

    public ListSubQuery list(Expression first, Expression second, 
            Expression... rest) {
        return detachable.list(first, second, rest);
    }

    public ListSubQuery list(Expression... args) {
        return detachable.list(args);
    }

    public  ListSubQuery list(Expression projection) {
        return detachable.list(projection);
    }

    @Override
    public ListSubQuery list(Object... args) {
        return detachable.list(args);
    }

    public BooleanExpression notExists() {
        return detachable.notExists();
    }

    protected void setDetachable(Detachable detachable) {
        this.detachable = detachable;
    }

    public > ComparableSubQuery unique(ComparableExpression projection) {
        return detachable.unique(projection);
    }

    public > DateSubQuery unique(DateExpression projection) {
        return detachable.unique(projection);
    }

    public > DateTimeSubQuery unique(DateTimeExpression projection) {
        return detachable.unique(projection);
    }

    public SimpleSubQuery unique(Expression first, Expression second, Expression... rest) {
        return detachable.unique(first, second, rest);
    }

    public SimpleSubQuery unique(Expression... args) {
        return detachable.unique(args);
    }

    public  SimpleSubQuery unique(Expression projection) {
        return detachable.unique(projection);
    }

    public > NumberSubQuery unique(NumberExpression projection) {
        return detachable.unique(projection);
    }

    public BooleanSubQuery unique(Predicate projection) {
        return detachable.unique(projection);
    }
    
    public StringSubQuery unique(StringExpression projection) {
        return detachable.unique(projection);
    }

    public > TimeSubQuery unique(TimeExpression projection) {
        return detachable.unique(projection);
    }

    @Override
    public SimpleSubQuery unique(Object... args) {
        return detachable.unique(args);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy