Examples of Versioned


Examples of org.jboss.envers.Versioned

      }
    }

    // Checking if this property is explicitly audited or if all properties are.
    Audited aud = property.getAnnotation(Audited.class);
    Versioned ver = property.getAnnotation(Versioned.class);
    if (aud != null) {
      propertyData.setStore(aud.modStore());
      propertyData.setRelationTargetAuditMode(aud.targetAuditMode());
    } else if (ver != null) {
      propertyData.setStore(ModificationStore.FULL);
View Full Code Here

Examples of org.mongodb.morphia.entities.version.Versioned

public class TestVersionAnnotation extends TestBase {

    @Test
    public void testVersionNumbersIncrementWithEachSave() throws Exception {
        final Versioned version1 = new Versioned();
        getDs().save(version1);
        assertEquals(new Long(1), version1.getVersion());

        final Versioned version2 = getDs().get(Versioned.class, version1.getId());
        getDs().save(version2);
        assertEquals(new Long(2), version2.getVersion());
    }
View Full Code Here

Examples of org.mongodb.morphia.entities.version.Versioned

    }

    @Test(expected = ConcurrentModificationException.class)
    public void testThrowsExceptionWhenTryingToSaveAnOldVersion() throws Exception {
        // given
        final Versioned version1 = new Versioned();
        getDs().save(version1);
        final Versioned version2 = getDs().get(Versioned.class, version1.getId());
        getDs().save(version2);

        // when
        getDs().save(version1);
    }
View Full Code Here

Examples of org.mongodb.morphia.entities.version.Versioned

        getDs().save(version1);
    }

    @Test
    public void testVersionedInserts() {
        Versioned[] versioneds = {new Versioned(), new Versioned(), new Versioned(), new Versioned(), new Versioned()};
        getAds().insert(versioneds);
        for (Versioned versioned : versioneds) {
            assertNotNull(versioned.getVersion());
        }
    }
View Full Code Here

Examples of org.mongodb.morphia.entities.version.Versioned

        assertEquals(mappedClasses.iterator().next().getClazz(), VersionedChildEntity.class);
    }

    @Test
    public void testUpdatesToVersionedFileAreReflectedInTheDatastore() {
        final Versioned version1 = new Versioned();
        version1.setName("foo");

        this.getDs().save(version1);

        final Versioned version1Updated = getDs().get(Versioned.class, version1.getId());
        version1Updated.setName("bar");

        this.getDs().merge(version1Updated);

        final Versioned versionedEntityFromDs = this.getDs().get(Versioned.class, version1.getId());
        assertEquals(version1Updated.getName(), versionedEntityFromDs.getName());
    }
View Full Code Here

Examples of voldemort.versioning.Versioned

    // when
    final Message<Car> message = MessageBuilder.withPayload( car ).setHeader( VoldemortHeaders.KEY, carId ).build();
    voldemortOutboundPutChannel.send( message );

    // then
    final Versioned found = storeClient.get( carId );
    Assert.assertEquals( car, found.getValue() );

    context.close();
  }
View Full Code Here

Examples of voldemort.versioning.Versioned

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).setHeader( VoldemortHeaders.KEY, lukasz.getId() ).build();
    voldemortOutboundPutChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );

    context.close();
  }
View Full Code Here

Examples of voldemort.versioning.Versioned

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertNull( found );

    context.close();
  }
View Full Code Here

Examples of voldemort.versioning.Versioned

    final Message<Person> message = MessageBuilder.withPayload( lukasz )
        .setHeader( VoldemortHeaders.PERSIST_MODE, PersistMode.PUT ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );

    context.close();
  }
View Full Code Here

Examples of voldemort.versioning.Versioned

    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOrderChannel.send( message );

    // then
    messageUpdater.updatePerson( copy );
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( copy, found.getValue() );

    context.close();
  }
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.