Examples of VersionedUser


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

  public void favoursVersionAnnotationIfPresent() {

    EntityInformation<VersionedUser, Long> information = new JpaMetamodelEntityInformation<VersionedUser, Long>(
        VersionedUser.class, em.getMetamodel());

    VersionedUser entity = new VersionedUser();
    assertThat(information.isNew(entity), is(true));
    entity.setId(1L);
    assertThat(information.isNew(entity), is(true));
    entity.setVersion(1L);
    assertThat(information.isNew(entity), is(false));
    entity.setId(null);
    assertThat(information.isNew(entity), is(false));
  }
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.