Examples of LikeParameterBinding


Examples of org.springframework.data.jpa.repository.query.StringQuery.LikeParameterBinding

    assertThat(query.getQueryString(), is("select u from User u where u.firstname like ?1 or u.lastname like ?2"));

    List<ParameterBinding> bindings = query.getParameterBindings();
    assertThat(bindings, hasSize(2));

    LikeParameterBinding binding = (LikeParameterBinding) bindings.get(0);
    assertThat(binding, is(notNullValue()));
    assertThat(binding.hasPosition(1), is(true));
    assertThat(binding.getType(), is(Type.CONTAINING));

    binding = (LikeParameterBinding) bindings.get(1);
    assertThat(binding, is(notNullValue()));
    assertThat(binding.hasPosition(2), is(true));
    assertThat(binding.getType(), is(Type.ENDING_WITH));
  }
View Full Code Here

Examples of org.springframework.data.jpa.repository.query.StringQuery.LikeParameterBinding

    assertThat(query.getQueryString(), is("select u from User u where u.firstname like :firstname"));

    List<ParameterBinding> bindings = query.getParameterBindings();
    assertThat(bindings, hasSize(1));

    LikeParameterBinding binding = (LikeParameterBinding) bindings.get(0);
    assertThat(binding, is(notNullValue()));
    assertThat(binding.hasName("firstname"), is(true));
    assertThat(binding.getType(), is(Type.ENDING_WITH));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.