1 package de.fhdw.wtf.persistence.meta;
2
3
4
5
6
7 public class UserObject extends Object {
8
9
10
11
12 private final long id;
13
14
15
16
17
18
19
20
21
22
23
24 public static UserObject init(final long id, final Type instanceOf) {
25 if (instanceOf.isTrans()) {
26 return new UserTransaction(id, instanceOf);
27 } else {
28 return new UserObject(id, instanceOf);
29 }
30 }
31
32
33
34
35
36
37
38
39
40
41 protected UserObject(final long id, final Type instanceOf) {
42 super(instanceOf);
43 this.id = id;
44 }
45
46 @Override
47 public long getId() {
48 return this.id;
49 }
50
51 @Override
52 public boolean isTheSameAs(final java.lang.Object other) {
53 if (!(other instanceof UserObject)) {
54 return false;
55 }
56
57 final UserObject uo = (UserObject) other;
58
59 return this.getId() == uo.getId();
60 }
61
62 }