Package org.springframework.data.cassandra.mapping

Examples of org.springframework.data.cassandra.mapping.BasicCassandraPersistentProperty


    assertTrue(property.isIdProperty());
    assertTrue(property.isCompositePrimaryKey());
  }

  private CassandraPersistentProperty getPropertyFor(Field field) {
    return new BasicCassandraPersistentProperty(field, null, entity, new CassandraSimpleTypeHolder());
  }
View Full Code Here


    Field field = ReflectionUtils.findField(Timeline.class, "time");
    assertThat(getPropertyFor(field).getColumnName().toCql(), is("time"));
  }

  private CassandraPersistentProperty getPropertyFor(Field field) {
    return new BasicCassandraPersistentProperty(field, null, entity, new CassandraSimpleTypeHolder());
  }
View Full Code Here

  @Test
  public void validateMappingInfo() {

    Field field = ReflectionUtils.findField(Thing.class, "id");
    CassandraPersistentProperty property = new BasicCassandraPersistentProperty(field, null, thing, SIMPLE_TYPE_HOLDER);
    assertTrue(property.isIdProperty());
    assertTrue(property.isCompositePrimaryKey());

    List<CqlIdentifier> expectedColumnNames = Arrays.asList(new CqlIdentifier[] { cqlId("z"), cqlId("a") });
    assertTrue(expectedColumnNames.equals(property.getColumnNames()));

    List<CqlIdentifier> actualColumnNames = new ArrayList<CqlIdentifier>();
    List<CassandraPersistentProperty> properties = property.getCompositePrimaryKeyProperties();
    for (CassandraPersistentProperty p : properties) {
      actualColumnNames.addAll(p.getColumnNames());
    }
    assertTrue(expectedColumnNames.equals(actualColumnNames));
View Full Code Here

TOP

Related Classes of org.springframework.data.cassandra.mapping.BasicCassandraPersistentProperty

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.