Examples of RepositoryMetadata


Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-364
   */
  @Test
  public void ignoresCrudMethodsAnnotatedWithQuery() throws Exception {

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class);
    RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class, null);

    Method method = BaseRepository.class.getMethod("findOne", Serializable.class);

    assertThat(information.getQueryMethods(), hasItem(method));
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-385
   */
  @Test
  public void findsTargetSaveForIterableIfEntityImplementsIterable() throws Exception {

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(BossRepository.class);
    RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class, null);

    Method method = BossRepository.class.getMethod("save", Iterable.class);
    Method reference = CrudRepository.class.getMethod("save", Iterable.class);

View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-441
   */
  @Test
  public void getQueryShouldNotReturnAnyBridgeMethods() {

    RepositoryMetadata metadata = new DefaultRepositoryMetadata(CustomDefaultRepositoryMethodsRepository.class);
    RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class, null);

    for (Method method : information.getQueryMethods()) {
      assertFalse(method.isBridge());
    }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

public class AnnotationRepositoryMetadataUnitTests {

  @Test
  public void handlesRepositoryProxyAnnotationCorrectly() {

    RepositoryMetadata metadata = new AnnotationRepositoryMetadata(AnnotatedRepository.class);
    assertEquals(User.class, metadata.getDomainType());
    assertEquals(Integer.class, metadata.getIdType());
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-98
   */
  @Test
  public void discoversSimpleReturnTypeCorrectly() throws Exception {

    RepositoryMetadata metadata = new DummyRepositoryMetadata(UserRepository.class);
    Method method = UserRepository.class.getMethod("findSingle");
    assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class)));
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

  /**
   * @see DATACMNS-98
   */
  @Test
  public void resolvesTypeParameterReturnType() throws Exception {
    RepositoryMetadata metadata = new DummyRepositoryMetadata(ConcreteRepository.class);
    Method method = ConcreteRepository.class.getMethod("intermediateMethod");
    assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class)));
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-98
   */
  @Test
  public void determinesReturnTypeFromPageable() throws Exception {

    RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class);
    Method method = ExtendingRepository.class.getMethod("findByFirstname", Pageable.class, String.class);
    assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class)));
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-453
   */
  @Test
  public void nonPageableRepository() {

    RepositoryMetadata metadata = new DummyRepositoryMetadata(UserRepository.class);
    assertThat(metadata.isPagingRepository(), is(false));
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

   * @see DATACMNS-453
   */
  @Test
  public void pageableRepository() {

    RepositoryMetadata metadata = new DummyRepositoryMetadata(PagedRepository.class);
    assertThat(metadata.isPagingRepository(), is(true));
  }
View Full Code Here

Examples of org.springframework.data.repository.core.RepositoryMetadata

  /**
   * @see DATACMNS-98
   */
  @Test
  public void determinesReturnTypeFromGenericType() throws Exception {
    RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class);
    Method method = ExtendingRepository.class.getMethod("someMethod");
    assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(GenericType.class)));
  }
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.