2 * Copyright © 2016-2017 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.notification.dao.types;
19 import com.datastax.driver.mapping.annotations.Column;
20 import com.datastax.driver.mapping.annotations.PartitionKey;
21 import com.datastax.driver.mapping.annotations.Table;
23 import java.util.Objects;
24 import java.util.UUID;
26 @Table(keyspace = "dox", name = "last_notification")
27 public class LastSeenNotificationEntity {
28 public static final String ENTITY_TYPE = "Event Notification";
31 @Column(name = "owner_id")
32 private String ownerId;
34 @Column(name = "event_id")
35 private UUID lastEventId;
38 * Every entity class must have a default constructor according to
39 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
40 * Definition of mapped classes</a>.
42 public LastSeenNotificationEntity() {
43 // Don't delete! Default constructor is required by DataStax driver
47 * Instantiates a new Notification entity.
49 * @param ownerId the owner id
50 * @param lastEventId the last event id
52 public LastSeenNotificationEntity(String ownerId, UUID lastEventId) {
53 this.ownerId = ownerId;
54 this.lastEventId = lastEventId;
57 public String getOwnerId() {
61 public void setOwnerId(String ownerId) {
62 this.ownerId = ownerId;
65 public UUID getLastEventId() {
69 public void setLastEventId(UUID lastEventId) {
70 this.lastEventId = lastEventId;
74 public boolean equals(Object o) {
75 if (this == o) return true;
76 if (o == null || getClass() != o.getClass()) return false;
77 LastSeenNotificationEntity that = (LastSeenNotificationEntity) o;
78 return Objects.equals(ownerId, that.ownerId) &&
79 Objects.equals(lastEventId, that.lastEventId);
83 public int hashCode() {
84 return Objects.hash(ownerId, lastEventId);
88 public String toString() {
89 return "LastSeenNotificationEntity {"
90 + "ownerId='" + ownerId + '\''