Examples of ClusteredKey


Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithEnumCompoundKey.ClusteredKey

  @Test
  public void should_refresh() throws Exception {

    long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
    compoundKey = new ClusteredKey(partitionKey, Type.FILE);

    entity = new ClusteredEntityWithEnumCompoundKey(compoundKey, "clustered_value");

    entity = manager.insert(entity);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

  private ObjectMapper mapper = new ObjectMapper();

  @Test
  public void should_persist_and_find() throws Exception {
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");
    Holder holder = new Holder("content");
    entity = new ClusteredEntityWithObjectValue(compoundKey, holder);

    manager.insert(entity);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

    assertThat(found.getValue()).isEqualTo(holder);
  }

  @Test
  public void should_persist_and_get_proxy() throws Exception {
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");
    Holder holder = new Holder("content");
    entity = new ClusteredEntityWithObjectValue(compoundKey, holder);

    manager.insert(entity);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

  }

  @Test
  public void should_merge_modifications() throws Exception {

    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");
    Holder holder = new Holder("content");
    Holder newHolder = new Holder("new_content");
    entity = new ClusteredEntityWithObjectValue(compoundKey, holder);

    entity = manager.insert(entity);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

    assertThat(entity.getValue()).isEqualTo(newHolder);
  }

  @Test
  public void should_delete() throws Exception {
    compoundKey = new ClusteredKey(RandomUtils.nextLong(0,Long.MAX_VALUE), "name");
    Holder holder = new Holder("content");
    entity = new ClusteredEntityWithObjectValue(compoundKey, holder);

    entity = manager.insert(entity);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

  @Test
  public void should_refresh() throws Exception {

    long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
    compoundKey = new ClusteredKey(partitionKey, "name");
    Holder holder = new Holder("content");
    Holder newHolder = new Holder("new_content");

    entity = new ClusteredEntityWithObjectValue(compoundKey, holder);
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithObjectValue.ClusteredKey

    assertThat(entities.get(0).getValue().getContent()).isEqualTo("name1");
    assertThat(entities.get(1).getValue().getContent()).isEqualTo("name3");
  }

  private void insertClusteredEntity(Long partitionKey, String name, Holder clusteredValue) {
    ClusteredKey embeddedId = new ClusteredKey(partitionKey, name);
    ClusteredEntityWithObjectValue entity = new ClusteredEntityWithObjectValue(embeddedId, clusteredValue);
    manager.insert(entity);
  }
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithReverseClustering.ClusteredKey

      insertClusteredEntity(partitionKey, i, namePrefix + i, clusteredValuePrefix + i);
    }
  }

  private void insertClusteredEntity(Long partitionKey, int count, String name, String clusteredValue) {
    ClusteredKey embeddedId = new ClusteredKey(partitionKey, count, name);
    ClusteredEntityWithReverseClustering entity = new ClusteredEntityWithReverseClustering(embeddedId,
        clusteredValue);
    manager.insert(entity);
  }
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithStaticColumn.ClusteredKey

    /////////////////////// STATIC AND NON STATIC SIMPLE COLUMNS ////////////////////////////////
    @Test
    public void should_query_static_column() throws Exception {
        Long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
        ClusteredEntityWithStaticColumn parisStreet1 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street1"), "Paris", "rue de la paix");
        ClusteredEntityWithStaticColumn parisStreet2 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street2"), "Paris", "avenue des Champs Elysees");

        manager.insert(parisStreet1);
        manager.insert(parisStreet2);

        List<ClusteredEntityWithStaticColumn> found = manager.sliceQuery(ClusteredEntityWithStaticColumn.class)
                .forSelect()
                .withPartitionComponents(partitionKey)
                .get(100);

        assertThat(found).hasSize(2);
        final ClusteredEntityWithStaticColumn foundParisStreet1 = found.get(0);
        final ClusteredEntityWithStaticColumn foundParisStreet2 = found.get(1);

        assertThat(foundParisStreet1.getStreet()).isEqualTo("rue de la paix");
        assertThat(foundParisStreet2.getStreet()).isEqualTo("avenue des Champs Elysees");

        ClusteredEntityWithStaticColumn lyonStreet3 = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street3"), "Lyon", "rue Lamartine");
        manager.insert(lyonStreet3);

        found = manager.sliceQuery(ClusteredEntityWithStaticColumn.class)
                .forSelect()
                .withPartitionComponents(partitionKey)
View Full Code Here

Examples of info.archinnov.achilles.test.integration.entity.ClusteredEntityWithStaticColumn.ClusteredKey

    @Test
    public void should_update_static_and_non_static_column() throws Exception {
        //Given
        Long partitionKey = RandomUtils.nextLong(0,Long.MAX_VALUE);
        ClusteredEntityWithStaticColumn parisStreet = new ClusteredEntityWithStaticColumn(new ClusteredKey(partitionKey, "street1"), "Paris", "rue de la paix");

        final ClusteredEntityWithStaticColumn managed = manager.insert(parisStreet);

        //When
        managed.setStreet("rue Lamartine");
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.