Removed DOCUMENT ME comments that were generated and applied source code
[utils] / support / general / src / main / java / org / wamblee / persistence / AbstractPersistent.java
1 /*
2  * Copyright 2005 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  *      http://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 package org.wamblee.persistence;
17
18 import java.io.Serializable;
19
20 /**
21  * Default implementation of Persistent.
22  * 
23  * @author Erik Brakkee
24  */
25 public abstract class AbstractPersistent implements Persistent {
26     /**
27      * Primary key.
28      */
29     private Serializable primaryKey;
30
31     /**
32      * Version.
33      */
34     private int version;
35
36     /**
37      * Constructs the object.
38      * 
39      */
40     protected AbstractPersistent() {
41         primaryKey = null;
42         version = -1;
43     }
44
45     /**
46      * Copy constructor.
47      * 
48      * @param aPersistent
49      *            Object to copy.
50      */
51     protected AbstractPersistent(AbstractPersistent aPersistent) {
52         primaryKey = aPersistent.primaryKey;
53         version = aPersistent.version;
54     }
55
56     /*
57      * (non-Javadoc)
58      * 
59      * @see org.wamblee.persistence.Persistent#getPrimaryKey()
60      */
61     public Serializable getPrimaryKey() {
62         return primaryKey;
63     }
64
65     /*
66      * (non-Javadoc)
67      * 
68      * @see
69      * org.wamblee.persistence.Persistent#setPrimaryKey(java.io.Serializable)
70      */
71     public void setPrimaryKey(Serializable aKey) {
72         primaryKey = aKey;
73     }
74
75     /*
76      * (non-Javadoc)
77      * 
78      * @see org.wamblee.persistence.Persistent#getPersistedVersion()
79      */
80     public int getPersistedVersion() {
81         return version;
82     }
83
84     /*
85      * (non-Javadoc)
86      * 
87      * @see org.wamblee.persistence.Persistent#setPersistedVersion(int)
88      */
89     public void setPersistedVersion(int aVersion) {
90         version = aVersion;
91     }
92 }