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>Integer</code> based identity.
22 *
23 * @author Ben Alex
24 * @version $Id: PersistableEntityInteger.java,v 1.5 2005/11/17 00:55:49 benalex Exp $
25 */
26 public abstract class PersistableEntityInteger extends AbstractPersistableEntity {
27
28
29 protected Integer id;
30
31
32
33 /***
34 * DO NOT USE DIRECTLY.
35 *
36 * <p>
37 * Typically only used by the persistence layer, but provided with public
38 * visibility to not limit flexibility.
39 * </p>
40 *
41 * @param id the new instance identity
42 */
43 public void setId(Integer id) {
44 this.id = id;
45 }
46
47 /***
48 * Obtains the persistence identity of this instance.
49 *
50 * <p>Marked as abstract to remind users to implement. They'll need to implement
51 * so their annotations reflect the correct sequence name.
52 */
53 public abstract Integer getId();
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 }