Created
April 15, 2018 19:23
-
-
Save lankydan/d174a8d4d0360a9cc48bed1f25424359 to your computer and use it in GitHub Desktop.
Datastax driver - person entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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