com.github.rutledgepaulv.qbuilders.delegates.virtual.ExistentialPropertyDelegate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of q-builders Show documentation
Show all versions of q-builders Show documentation
A type-safe and database agnostic query building library.
The newest version!
/*
*
* * com.github.rutledgepaulv.qbuilders.delegates.virtual.ExistentialPropertyDelegate
* * *
* * * Copyright (C) 2016 Paul Rutledge
* * *
* * * This software may be modified and distributed under the terms
* * * of the MIT license. See the LICENSE file for details.
* *
*
*/
package com.github.rutledgepaulv.qbuilders.delegates.virtual;
import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
import com.github.rutledgepaulv.qbuilders.conditions.Condition;
import com.github.rutledgepaulv.qbuilders.operators.ComparisonOperator;
import com.github.rutledgepaulv.qbuilders.properties.virtual.ExistentialProperty;
import com.github.rutledgepaulv.qbuilders.structures.FieldPath;
import java.util.Collections;
public abstract class ExistentialPropertyDelegate> extends PropertyDelegate
implements ExistentialProperty {
protected ExistentialPropertyDelegate(FieldPath field, T canonical) {
super(field, canonical);
}
public final Condition exists() {
return condition(getField(), ComparisonOperator.EX, Collections.singletonList(true));
}
public final Condition doesNotExist() {
return condition(getField(), ComparisonOperator.EX, Collections.singletonList(false));
}
}