|
| 1 | +/* |
| 2 | + * Copyright 2012-2020 the original author or authors |
| 3 | + * |
| 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 |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 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. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.springframework.data.couchbase.domain; |
| 18 | + |
| 19 | +import java.util.Objects; |
| 20 | + |
| 21 | +import org.springframework.data.annotation.CreatedBy; |
| 22 | +import org.springframework.data.annotation.CreatedDate; |
| 23 | +import org.springframework.data.annotation.Id; |
| 24 | +import org.springframework.data.annotation.LastModifiedBy; |
| 25 | +import org.springframework.data.annotation.LastModifiedDate; |
| 26 | +import org.springframework.data.annotation.PersistenceConstructor; |
| 27 | +import org.springframework.data.annotation.Transient; |
| 28 | +import org.springframework.data.annotation.Version; |
| 29 | +import org.springframework.data.couchbase.core.mapping.Document; |
| 30 | + |
| 31 | +/** |
| 32 | + * User entity for tests |
| 33 | + * |
| 34 | + * @author Michael Reiche |
| 35 | + */ |
| 36 | + |
| 37 | +public abstract class AbstractUser extends ComparableEntity { |
| 38 | + |
| 39 | + @Version protected long version; |
| 40 | + @Id protected String key; |
| 41 | + protected String firstname; |
| 42 | + protected String lastname; |
| 43 | + @Transient protected String transientInfo; |
| 44 | + @CreatedBy protected String createdBy; |
| 45 | + @CreatedDate protected long createdDate; |
| 46 | + @LastModifiedBy protected String lastModifiedBy; |
| 47 | + @LastModifiedDate protected long lastModifiedDate; |
| 48 | + |
| 49 | + public String getId() { |
| 50 | + return key; |
| 51 | + } |
| 52 | + |
| 53 | + public String getFirstname() { |
| 54 | + return firstname; |
| 55 | + } |
| 56 | + |
| 57 | + public String getLastname() { |
| 58 | + return lastname; |
| 59 | + } |
| 60 | + |
| 61 | + public long getCreatedDate() { |
| 62 | + return createdDate; |
| 63 | + } |
| 64 | + |
| 65 | + public void setCreatedDate(long createdDate) { |
| 66 | + this.createdDate = createdDate; |
| 67 | + } |
| 68 | + |
| 69 | + public String getCreatedBy() { |
| 70 | + return createdBy; |
| 71 | + } |
| 72 | + |
| 73 | + public void setCreatedBy(String createdBy) { |
| 74 | + this.createdBy = createdBy; |
| 75 | + } |
| 76 | + |
| 77 | + public long getLastModifiedDate() { |
| 78 | + return lastModifiedDate; |
| 79 | + } |
| 80 | + |
| 81 | + public String getLastModifiedBy() { |
| 82 | + return lastModifiedBy; |
| 83 | + } |
| 84 | + |
| 85 | + public long getVersion() { |
| 86 | + return version; |
| 87 | + } |
| 88 | + |
| 89 | + public void setVersion(long version) { |
| 90 | + this.version = version; |
| 91 | + } |
| 92 | + |
| 93 | + @Override |
| 94 | + public int hashCode() { |
| 95 | + return Objects.hash(getId(), firstname, lastname); |
| 96 | + } |
| 97 | + |
| 98 | + public String getTransientInfo() { |
| 99 | + return transientInfo; |
| 100 | + } |
| 101 | + |
| 102 | + public void setTransientInfo(String something) { |
| 103 | + transientInfo = something; |
| 104 | + } |
| 105 | +} |
0 commit comments