Example usage for org.springframework.data.querydsl.binding QuerydslBindings bind

List of usage examples for org.springframework.data.querydsl.binding QuerydslBindings bind

Introduction

In this page you can find the example usage for org.springframework.data.querydsl.binding QuerydslBindings bind.

Prototype

public final <T> TypeBinder<T> bind(Class<T> type) 

Source Link

Document

Returns a new TypeBinder for the given type.

Usage

From source file:example.users.UserRepository.java

@Override
default public void customize(QuerydslBindings bindings, QUser root) {

    bindings.bind(String.class).first((StringPath path, String value) -> path.containsIgnoreCase(value));
    bindings.excluding(root.password);//  w  w  w  .j  a  v  a2  s  .  c  om
}

From source file:example.springdata.rest.stores.StoreRepository.java

/**
 * Tweak the Querydsl binding if collection resources are filtered.
 * /* ww w .j a va 2  s. co m*/
 * @see org.springframework.data.web.querydsl.QuerydslBinderCustomizer#customize(org.springframework.data.web.querydsl.QuerydslBindings,
 *      com.mysema.query.types.EntityPath)
 */
default void customize(QuerydslBindings bindings, QStore store) {

    bindings.bind(store.address.city).first((path, value) -> path.endsWith(value));
    bindings.bind(String.class).first((StringPath path, String value) -> path.contains(value));
}