I haven't looked at the inner workings yet, but here's something
interesting. If I use a MutligetSliceQuery as follows and then use
EM.load with ColumnSlice everything works great.
MultigetSliceQuery<Long, String, byte[]> query =
HFactory.createMultigetSliceQuery(keyspace, longSerializer,
stringSerializer, byteArraySerializer);
query.setColumnFamily("House");
query.setKeys(1L,2L,3L,5L,6L,47L,437L,34L,26L,23L,8L,8956L,3467L,
2346L,623L,85L);
query.setRange("", "", false, 8);
QueryResult<Rows<Long,String, byte[]>> result = query.execute();
EntityManagerImpl em = new EntityManagerImpl(keyspace,
"com.test.cass");
List<House> houses = new ArrayList<House>(result.get().getCount());
for (Row row : result.get()) {
House house = em.load(House.class, row.getKey(),
row.getColumnSlice());
houses.add(house);
}
But if I use a CQL query such as Select * from House
CqlQuery<Long, String, byte[]> cqlQuery = new CqlQuery<Long, String,
byte[]>(keyspace, longSerializer, stringSerializer,
byteArraySerializer);
cqlQuery.setQuery("select * from House");
QueryResult<CqlRows<Long, String, byte[]>> resultCql =
cqlQuery.execute();
CqlRows<Long, String, byte[]> result = resultCql.get();
List<Formation> formations = new ArrayList<Formation>(10000);
EntityManagerImpl em = new EntityManagerImpl(keyspace,
"com.test.cass");
for (Row row : result.getList()) {
House house = em.load(House.class, row.getKey(),
row.getColumnSlice());
houses.add(house);
}
I get the above exception.
java.lang.IllegalArgumentException: Object type, class
com.test.cass.data.model.House, does not have a property named, KEY.
either add a setter for this property or use @AnonymousPropertyHandler
to annotate a method for handling anonymous properties
at
me.prettyprint.hom.HectorObjectMapper.createObject(HectorObjectMapper.java:
273)
...