Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:
http://groups.google.com/group/kundera-discuss/subscribe
Apache License 2.0
903 stars 233 forks source link

Null bigints in @Embeddable and/or in @ElementCollection #752

Closed gbrancovici-sam closed 9 years ago

gbrancovici-sam commented 9 years ago

Hi,

While trying to load a user profile from Cassandra using Kundera with the DataStax DSClientFactory, I was able to properly retrieve all fields, except for the bigints. No matter at which level they're embedded, all of them are left null (ignored) by EntityManager.find although they're set in the database:

INFO [2015-06-05 21:09:50,342] com.company.data.cassandra.entitymanager.JPAEntityManagerAdapter: 76773c90-0969-11e5-ae1e-22000ba28362: User(id=76773c90-0969-11e5-ae1e-22000ba28362, custKeys=[CustKey(bpI=015668, bpX=805668, sAc=alpha@beta.com, cUid=xyajkaaabcc)], personalInfo=PersonalInfo(fname=Walter, mname=, lname=Matthau, title=Mr, suffix=Jr, dob=1920-03-11), demographics=Demographics(ethnicity=MARS, hhIncome=null, housingType=SINGLE_FAMILY, numberChildren=null, numberAdults=null), segments=[Biker, Nascar], emailContacts=[EmailContact(email=alpha@beta.com, type=SECONDARY, optinStatus=Y), EmailContact(email=gamma@delta.com, type=PRIMARY, optinStatus=Y)], phoneContacts=[PhoneContact(cntry_code=null, regionCode=null, number=abcdef, type=mobile, optinStatus=Y)])

I'm using the following dependencies:

com.impetus.kundera.client:kundera-cassandra-ds-driver:2.17
com.datastax.cassandra:cassandra-driver-core:2.1.6
io.netty:netty:3.10.3.Final

Here are some of the data definitions:

@ToString
@EqualsAndHashCode
@Entity
@Table(name = "user", schema = "user_profile@cassandra_pu")
public class User {
    @Id
    @Column(name="id")
    private String id;

    @ElementCollection
    @Column(name="cust_keys")
    private Set<CustKey> custKeys = new HashSet<CustKey>();

    @Embedded
    @Column(name="personal_info")
    private PersonalInfo personalInfo;

    @Embedded
    @Column(name="demographics")
    private Demographics demographics;

    @ElementCollection
    @Column(name="segments")
    private Set<String> segments = new HashSet<String>();

    @ElementCollection
    @Column(name = "email_contacts")
    private Set<EmailContact> emailContacts = new HashSet<EmailContact>();

    @ElementCollection
    @Column(name = "phone_contacts")
    private Set<PhoneContact> phoneContacts = new HashSet<PhoneContact>();
}

@Data
@ToString
@EqualsAndHashCode
@Embeddable
public class Demographics {
    @Column(name = "ethnicity")
    private String ethnicity;

    @Column(name = "hh_income")
    private Long hhIncome;

    @Column(name = "housing_type")
    private String housingType;

    @Column(name = "number_children")
    private Long numberChildren;

    @Column(name = "number_adults")
    private Long numberAdults;
}

@Data
@ToString
@EqualsAndHashCode
@Embeddable
public class PhoneContact {
    @Column(name = "cntry_code")
    private Long cntry_code;

    @Column(name = "region_code")
    private Long regionCode;

    @Column(name = "number")
    private String number;

    @Column(name = "type")
    private String type;

    @Column(name = "optin_status")
    private String optinStatus;
}

Any idea what is going on?

karthikprasad13 commented 9 years ago

@haidukus

 Hi,

A fix for the issue has been added. In order to use it right away, you can build Kundera from trunk. The fix will be a part of Kundera's upcoming release scheduled end of this month.

-Karthik.

gbrancovici-sam commented 9 years ago

Sounds great, thanks for the quick response!

gbrancovici-sam commented 9 years ago

Hi, any ETA on the upcoming release?

chhavigangwal commented 9 years ago

@haidukus

Kundera 3.0 will be released on 22nd July.

Chhavi

gbrancovici-sam commented 9 years ago

Thanks!

chhavigangwal commented 9 years ago

Fixed with Kundera 3.0 release.