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

com.blinkfox.fenix.specification.handler.impl.NotEndsWithPredicateHandler Maven / Gradle / Ivy

Go to download

This is an extension library to the Spring Data JPA complex or dynamic SQL query. 这是一个为了解决复杂动态 SQL (JPQL) 而生的 Spring Data JPA 扩展库,能辅助开发者更方便快捷的书写复杂、动态且易于维护的 SQL,支持 ActiveRecord 模式和多种查询方式。

There is a newer version: 3.0.0
Show newest version
package com.blinkfox.fenix.specification.handler.impl;

import com.blinkfox.fenix.specification.annotation.NotEndsWith;
import com.blinkfox.fenix.specification.handler.AbstractPredicateHandler;
import java.lang.annotation.Annotation;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.From;
import javax.persistence.criteria.Predicate;

/**
 * 构建“按后缀模糊不匹配”({@code AND field NOT LIKE '%xx'})场景的 {@link Predicate} 处理器.
 *
 * @author blinkfox on 2020-01-26
 * @since v2.2.0
 */
public class NotEndsWithPredicateHandler extends AbstractPredicateHandler {

    @Override
    public Class getAnnotation() {
        return NotEndsWith.class;
    }

    @Override
    public  Predicate buildPredicate(
            CriteriaBuilder criteriaBuilder, From from, String fieldName, Object value, Annotation annotation) {
        return criteriaBuilder.and(super.buildNotEndsWithPredicate(criteriaBuilder, from, fieldName, value));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy