Joining to super columns families
Is it possible to join to super colums families? In the example below, I am seeing none of the subcolumns being stored. The id column is being stored though. The motivation for using a column family for customer instead of a super column family is that I want to have secondary indexes on some customer fields.
@Entity
@Table(name = "users", schema = "data@dev")
public class Customer {
@Id
@Column(name="id")
String customerId;
@Column
String name;
@Column
String phoneNumber;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="id")
Shipments shipments;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="id")
Messages messages;
}
@Entity
@Table(name = "shipments", schema = "data@dev")
public class Shipments {
@Id
@Column(name="id")
String customerId;
@ElementCollection
@CollectionTable(name="shipment")
List<Shipment> shipments;
}
@Embeddable
public class Shipment {
@Column
long sendDate;
@Column
String warehouse;
@Column
String address;
}
@Entity
@Table(name = "messages", schema = "data@dev")
public class Messages {
@Id
@Column(name="id")
String customerId;
@ElementCollection
@CollectionTable(name="shipment")
List<Messages> messages;
}
@Embeddable
public class Message {
@Column
long timestamp;
@Column
String body;
}
Not supported in Kundera 2.3. 2.4 will enable support. Super columns will be deprecated in near future. So i guess if you try same example with Composite key over Messages and Shipments, it should work you.
-Vivek
Please ignore my previous comments. I missed out that User is a column family. I guess that should work.
Amresh: Please verify
-Vivek
Hi rramdin, Association OneToOne with PrimaryKeyJoinColumn is a known bug in kundera-2.3 it will be fixed in 2.4.
Thanks and Regards Kuldeep
Joining both super column families and column families is possible.
Shared by primary key will be available with 2.4 release. Is there anything which need to be sum up?
-Vivek
Shared by Primary key support added and releasing with 2.4