cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From IPVP <i...@hotmail.com>
Subject Using UDT Collection to store user aggregated data
Date Fri, 18 Sep 2015 02:29:47 GMT
Hi all,

Could someone please let me know if the following modeling is on the right way ? 

Te requirement is to query by user_id the summarized data  of transaction_status_per_user.
-----
### UDT
CREATE TYPE core_analytics.status_summary (
	name text,
	count int,
	hexcolor text
);

### TABLE
CREATE TABLE core_analytics.transaction_status_per_user (
	user_id uuid,
	statuses LIST<FROZEN<status_summary>>,
	PRIMARY KEY (user_id)
);

###Java Mapping

@UDT(keyspace = "core_analytics", name = "status_summary")
public class StatusSummary {

    private String name;
    private Integer count;
    private String hexcolor;
      
   // getters setters omitted
}
-----


Thanks


IP


Mime
View raw message