1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.acegisecurity.domain.impl;
17
18 import java.io.Serializable;
19
20 /***
21 * A persistable entity that uses a <code>Long</code> based identity.
22 *
23 * @author Ben Alex
24 * @version $Id: PersistableEntityLong.java,v 1.7 2005/11/17 00:55:49 benalex Exp $
25 */
26 public abstract class PersistableEntityLong extends AbstractPersistableEntity {
27
28
29 protected Long id;
30
31
32
33
34 /***
35 * DO NOT USE DIRECTLY.
36 *
37 * <p>
38 * Typically only used by the persistence layer, but provided with public
39 * visibility to not limit flexibility.
40 * </p>
41 *
42 * @param id the new instance identity
43 */
44 public void setId(Long id) {
45 this.id = id;
46 }
47
48 /***
49 * Obtains the persistence identity of this instance.
50 */
51 public Long getId() {
52 return this.id;
53 }
54
55 /***
56 * DO NOT USE DIRECTLY.
57 *
58 * <p>
59 * Use {@link #getId()} instead, as it provides the correct return type.
60 * This method is only provided for use by the persistence layer and to
61 * satisfy the {@link org.acegisecurity.domain.PersistableEntity}
62 * interface contract.
63 * </p>
64 *
65 * <p>
66 * Internally delegates to {@link #getId()}.
67 * </p>
68 *
69 * @return the instance's identity
70 */
71 public Serializable getInternalId() {
72 return this.getId();
73 }
74 }