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

com.heliorm.impl.LocalDateTimeFieldPart Maven / Gradle / Ivy

The newest version!
package com.heliorm.impl;

import com.heliorm.OrmException;
import com.heliorm.Table;
import com.heliorm.def.Continuation;
import com.heliorm.def.LocalDateTimeField;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

import static com.heliorm.Field.FieldType.LOCAL_DATE_TIME;

/**
 * @author gideon
 */
public final class LocalDateTimeFieldPart extends FieldPart implements
        LocalDateTimeField,
        WithRangePart,
        WithEqualsPart,
        WithInPart, WithIsPart {

    public LocalDateTimeFieldPart(Table table, String javaName) {
        super(table, LOCAL_DATE_TIME, LocalDateTime.class, javaName);
    }


    @Override
    public Continuation eq(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.EQ, value);
    }

    @Override
    public Continuation notEq(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.NOT_EQ, value);
    }


    @Override
    public Continuation lt(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.LT, value);
    }

    @Override
    public Continuation le(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.LE, value);
    }

    @Override
    public Continuation gt(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.GT, value);
    }

    @Override
    public Continuation ge(LocalDateTime value) throws OrmException {
        return new ValueExpressionPart<>(getThis(), ValueExpressionPart.Operator.GE, value);
    }

    @Override
    public Continuation isNull() throws OrmException {
        return new IsExpressionPart<>(getThis(), IsExpressionPart.Operator.IS_NULL);
    }

    @Override
    public Continuation isNotNull() throws OrmException {
        return new IsExpressionPart<>(getThis(), IsExpressionPart.Operator.IS_NOT_NULL);
    }

    @Override
    public Continuation in(List values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.IN, values);
    }

    @Override
    public Continuation notIn(List values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.NOT_IN, values);
    }

    @Override
    public Continuation in(LocalDateTime... values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.IN, Arrays.asList(values));
    }

    @Override
    public Continuation notIn(LocalDateTime... values) throws OrmException {
        return new ListExpressionPart<>(getThis(), ListExpressionPart.Operator.NOT_IN, Arrays.asList(values));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy