Package org.springframework.data.jpa.domain.sample

Examples of org.springframework.data.jpa.domain.sample.PersistableWithIdClassPK


    idClassRepository.save(entity);

    assertThat(entity.getFirst(), is(notNullValue()));
    assertThat(entity.getSecond(), is(notNullValue()));

    PersistableWithIdClassPK id = new PersistableWithIdClassPK(entity.getFirst(), entity.getSecond());

    assertThat(idClassRepository.findOne(id), is(entity));
  }
View Full Code Here


    PersistableWithIdClass s1 = idClassRepository.save(new PersistableWithIdClass(1L, 1L));
    PersistableWithIdClass s2 = idClassRepository.save(new PersistableWithIdClass(2L, 2L));

    assertThat(idClassRepository.exists(s1.getId()), is(true));
    assertThat(idClassRepository.exists(s2.getId()), is(true));
    assertThat(idClassRepository.exists(new PersistableWithIdClassPK(1L, 2L)), is(false));
  }
View Full Code Here

    idClassRepository.save(entity);

    assertThat(entity.getFirst(), is(notNullValue()));
    assertThat(entity.getSecond(), is(notNullValue()));

    PersistableWithIdClassPK id = new PersistableWithIdClassPK(entity.getFirst(), entity.getSecond());

    assertThat(idClassRepository.exists(id), is(true));
  }
View Full Code Here

    JpaEntityInformation<PersistableWithIdClass, ?> information = JpaEntityInformationSupport.getMetadata(
        PersistableWithIdClass.class, em);
    Object id = information.getId(entity);

    assertThat(id, is(instanceOf(PersistableWithIdClassPK.class)));
    assertThat(id, is((Object) new PersistableWithIdClassPK(2L, 4L)));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.jpa.domain.sample.PersistableWithIdClassPK

Copyright © 2018 www.massapicom. 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.