net.shrine.sheriff.model
Class ProtocolNumberCounter

java.lang.Object
  extended by net.shrine.sheriff.model.ProtocolNumberCounter

public class ProtocolNumberCounter
extends Object


Constructor Summary
ProtocolNumberCounter()
           
 
Method Summary
static int getLast(org.hibernate.Session session, int year)
           
static int getNext(org.hibernate.Session session, int year)
          Drop to JDBC to atomically increment and make available for return the next protocol number value for a givern year.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProtocolNumberCounter

public ProtocolNumberCounter()
Method Detail

getLast

public static int getLast(org.hibernate.Session session,
                          int year)

getNext

public static int getNext(org.hibernate.Session session,
                          int year)
Drop to JDBC to atomically increment and make available for return the next protocol number value for a givern year. I believe that the SQL (LOCK TABLE syntax) is MYSQL specific.

Parameters:
session -
year -
Returns:
the value incremented by this connection

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.