Still problem. just test it:
kundera 3.8, cassandra 3.10
the for loop will throw exception:
public List<map_webcast_vote_option> findByQuestion(EntityManager em, String id) {
String sq = "select * from map_webcast_vote_option where question_message_id = ?1";
sq = Text.replaceQueryParam(sq, 1, id);
Query q = em.createNativeQuery(sq, map_webcast_vote_question.class);
List<map_webcast_vote_option> ls = q.getResultList();
for (map_webcast_vote_option a : ls) {
}
return ls;
}
create table map_webcast_vote_option (
id timeuuid,
question_message_id timeuuid,
to_webcast_id timeuuid,
question_code varchar,
code varchar,
description text,
vote_count bigint,
primary key (id)
);
create index map_webcast_vote_option__to_webcast_id
on map_webcast_vote_option (to_webcast_id);
create index map_webcast_vote_option__question_message_id
on map_webcast_vote_option (question_message_id);
[2017-04-20T10:26:21.240+0800] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=29 _
ThreadName=Thread-3] [timeMillis: 1492655181240] [levelValue: 800] [[
10:26:21.240 [http-listener-2(4)] WARN c.i.c.c.d.CassandraDataHandlerBase - E
rror while setting fieldcode value via CQL, Caused by: .
com.impetus.kundera.property.PropertyAccessException: java.lang.IllegalArgumentE
xception: Can not set java.lang.String field cn.x8p.map.entity.db.webcast.map_we
bcast_vote_question.code to java.util.HashMap
at com.impetus.kundera.property.PropertyAccessorHelper.set(PropertyAcces
sorHelper.java:110) ~[kundera-core-3.8.jar:na]
at com.impetus.client.cassandra.datahandler.CassandraDataHandlerBase.set
FieldValueViaCQL(CassandraDataHandlerBase.java:1509) [kundera-cassandra-3.8.jar:
na]
at com.impetus.client.cassandra.datahandler.CassandraDataHandlerBase.pop
ulateViaThrift(CassandraDataHandlerBase.java:1163) [kundera-cassandra-3.8.jar:na
]
at com.impetus.client.cassandra.datahandler.CassandraDataHandlerBase.onC
olumn(CassandraDataHandlerBase.java:1054) [kundera-cassandra-3.8.jar:na]
at com.impetus.client.cassandra.datahandler.CassandraDataHandlerBase.pop
ulateEntity(CassandraDataHandlerBase.java:653) [kundera-cassandra-3.8.jar:na]
at com.impetus.client.cassandra.CassandraClientBase$CQLClient.executeQue
ry(CassandraClientBase.java:2301) [kundera-cassandra-3.8.jar:na]
at com.impetus.client.cassandra.CassandraClientBase.executeSelectQuery(C
Caused by: java.lang.IllegalArgumentException: Can not set java.util.UUID field
cn.x8p.map.entity.db.webcast.map_webcast_vote_question.to_webcast_id to java.uti
l.HashMap
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(
UnsafeFieldAccessorImpl.java:167) ~[na:1.8.0_40]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(
UnsafeFieldAccessorImpl.java:171) ~[na:1.8.0_40]