org.objectweb.jorm.facility.naming.rdbsequence
Interface SequenceIdAllocator


public interface SequenceIdAllocator

Defines an identifier allocator based on a SQL sequence. This permits to support the inheritance with the use of a SQL sequence. Indeed, an identifier value MUST permit to find the class type of the persistent object. Then a way respect this constraint and to have an identifier allocation based on a sequence, is to modify the long value provided by the sequence in order to code the class identifier into the object identifier. This can be done by using one or several bits of the long value (in low or high position) for example.

Author:
S.Chassande-Barrioz

Method Summary
 long allocateId(long seqValue, java.lang.Object key)
          Allocate an identifier from a new computed sequence value, and the naming key of the persistant class.
 

Method Detail

allocateId

public long allocateId(long seqValue,
                       java.lang.Object key)
Allocate an identifier from a new computed sequence value, and the naming key of the persistant class.

Parameters:
key - is the value that you have put in the 'inheritance-key' extension.