forked from flipkart-incubator/hbase-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployee.java
48 lines (37 loc) · 1.13 KB
/
Employee.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.flipkart.hbaseobjectmapper.testcases.entities;
import com.flipkart.hbaseobjectmapper.*;
import lombok.*;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
@SuppressWarnings("unused")
@HBTable(name = "corp:employees", families = {@Family(name = "a")})
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class Employee extends AbstractRecord {
private Long empid;
@HBColumn(family = "a", column = "name")
private String empName;
@HBColumn(family = "a", column = "reportee_count")
private Short reporteeCount;
@Override
public Long composeRowKey() {
return empid;
}
@Override
public void parseRowKey(Long rowKey) {
empid = rowKey;
}
public Long getEmpid() {
return empid;
}
public Short getReporteeCount() {
return reporteeCount;
}
public Employee(Long empid, String empName, Short reporteeCount, Long createdAt) {
this.empid = empid;
this.empName = empName;
this.reporteeCount = reporteeCount;
this.createdAt = LocalDateTime.ofEpochSecond(createdAt, 0, ZoneOffset.UTC);
}
}