Skip to content

Instantly share code, notes, and snippets.

@lankydan
Created April 15, 2018 19:23
Show Gist options
  • Save lankydan/d174a8d4d0360a9cc48bed1f25424359 to your computer and use it in GitHub Desktop.
Save lankydan/d174a8d4d0360a9cc48bed1f25424359 to your computer and use it in GitHub Desktop.
Datastax driver - person entity
@Table(name = "people_by_country")
public class Person {
@PartitionKey
private String country;
@ClusteringColumn
private String firstName;
@ClusteringColumn(1)
private String lastName;
@ClusteringColumn(2)
private UUID id;
private int age;
private String profession;
private int salary;
private Person() {
}
public Person(String country, String firstName, String lastName, UUID id, int age, String profession, int salary) {
this.country = country;
this.firstName = firstName;
this.lastName = lastName;
this.id = id;
this.age = age;
this.profession = profession;
this.salary = salary;
}
// getters and setters for each property
// equals, hashCode, toString
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment