HBase table has Id column. I want to check it, if it isn't exist, controller calls add() method, if it's exist then controller calls update()
method. Id value is injected from Controller class to Service class. How can I count row number or check if Id existed?
More, my model has create_at
and update_at
, how can I update and dont update create_at column? create_at
is generated one time when add(), update_at store the last update time.
record.setCreateAt(Timestamp.valueOf(LocalDateTime.now()));
record.setUpdateAt(Timestamp.valueOf(LocalDateTime.now()));