valchkou / cassandra-driver-mapping

JPA addon for DataStax Java Driver for Cassandra
58 stars 24 forks source link

Lists returning empty after upgrading to version 3.0.0 #76

Open ChandanNM opened 8 years ago

ChandanNM commented 8 years ago

The mapping session is failing to return contents of List. Always returns empty though the row contains values

select * from carrier where pkid=ab4fe6ab-d4fe-459f-9a16-c5aa0974bda7;

pkid | apiexists | apiserviceurl | audits | carriercode | country | countrycode | defaultoffer | description | displayname | name | providerfqdn | providername | routingprofile | services | vendor --------------------------------------+-----------+---------------+--------+--------------------+---------+-------------+--------------+------------------+-------------+------+-----------------------+-------------------+--------------------+----------+-------- ab4fe6ab-d4fe-459f-9a16-c5aa0974bda7 | False | null | null | {'bogus': '12345'} | US | +1 | False | Carrier Description | null | Carrier | {'bogus': 'Carrier.com'} | {'bogus': 'Carrier'} | {'bogus': '24233'} | ['PSTN'] | Carrier

services is returned as []

Below is my DAO method -

@Inject
private MappingSession mappingSession;

@Override
public Carrier findCarrierByPkid(final UUID pkid) {
    return mappingSession.get(Carrier.class, pkid, TerminusUtils.getReadOptions(ONE));
}

This behavior is consistent and easily reproducible

ChandanNM commented 8 years ago

Same for Map (String,String) as well

ChandanNM commented 8 years ago

Hi Eugene, any luck reproducing this issue on your local workspace ?

anishgt commented 8 years ago

I too, faced the same issue for all three collections: List, Set and Map; using 3.0.0

chrisribble commented 8 years ago

I just created a PR that fixes this issue for single-level hierarchies of parameterized types and adds some more logging. Hopefully we can get it merged soon. @valchkou, what do you think about the changes?