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

org.ibatis.persist.impl.predicate.ExistsPredicate Maven / Gradle / Ivy

Go to download

The jBATIS persistence framework will help you to significantly reduce the amount of Java code that you normally need to access a relational database. iBATIS simply maps JavaBeans to SQL statements using a very simple XML descriptor.

The newest version!
package org.ibatis.persist.impl.predicate;

import org.ibatis.persist.criteria.Subquery;

import org.ibatis.persist.impl.CriteriaBuilderImpl;
import org.ibatis.persist.impl.Renderable;
import org.ibatis.persist.impl.RenderingContext;

/**
 * Models an EXISTS() predicate
 */
public class ExistsPredicate
		extends AbstractSimplePredicate {
	private final Subquery subquery;

	public ExistsPredicate(CriteriaBuilderImpl criteriaBuilder, Subquery subquery) {
		super( criteriaBuilder );
		this.subquery = subquery;
	}

	public Subquery getSubquery() {
		return subquery;
	}

	@Override
    public void render(boolean isNegated, RenderingContext rc) {
        rc.append(isNegated ? "not " : "").append("exists ");
        ((Renderable) getSubquery()).render(rc);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy