mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Having managed to get WCM-DEV royally screwed up, I made a new branch,
WCM-DEV2 and added back my changes. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2804 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
122
source/java/org/alfresco/repo/avm/hibernate/Issuer.java
Normal file
122
source/java/org/alfresco/repo/avm/hibernate/Issuer.java
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (C) 2006 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.avm.hibernate;
|
||||
|
||||
/**
|
||||
* This is a helper class that knows how to issue identifiers.
|
||||
* @author britt
|
||||
*/
|
||||
public class Issuer
|
||||
{
|
||||
/**
|
||||
* The name of this issuer. Used as the primary key in it's
|
||||
* mapping.
|
||||
*/
|
||||
private String fName;
|
||||
|
||||
/**
|
||||
* The next number to issue.
|
||||
*/
|
||||
private long fNext;
|
||||
|
||||
/**
|
||||
* The version (for concurrency control).
|
||||
*/
|
||||
private long fVers;
|
||||
|
||||
/**
|
||||
* Anonymous constructor.
|
||||
*/
|
||||
public Issuer()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Rich constructor.
|
||||
* @param name The name of this issuer.
|
||||
* @param next The next number to issue.
|
||||
*/
|
||||
public Issuer(String name, long next)
|
||||
{
|
||||
fName = name;
|
||||
fNext = next;
|
||||
}
|
||||
|
||||
// Bean methods.
|
||||
|
||||
/**
|
||||
* Set the name of this issuer.
|
||||
* @param name The name to set.
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
fName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of this issuer.
|
||||
* @return The name of this issuer.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return fName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the next number.
|
||||
* @param next The next number.
|
||||
*/
|
||||
public void setNext(long next)
|
||||
{
|
||||
fNext = next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next number.
|
||||
* @return The next number.
|
||||
*/
|
||||
public long getNext()
|
||||
{
|
||||
return fNext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Issue the next number.
|
||||
* @return A serial number.
|
||||
*/
|
||||
public long issue()
|
||||
{
|
||||
return fNext++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vers
|
||||
*/
|
||||
public long getVers()
|
||||
{
|
||||
return fVers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vers the vers to set
|
||||
*/
|
||||
public void setVers(long vers)
|
||||
{
|
||||
fVers = vers;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user