15.3. Sequences

Sequences are generators that are commonly used to create identity values or populate persistent fields. The package-level sequence element defines a named sequence. It has no child elements other than possible extensions, but uses the following attributes:

[Note]Note

Kodo allows you to use a plugin string describing one of Kodo's built-in sequence implementations for the factory-class attribute. See the Reference Guide's Section 9.7, “Generators” for built-in sequence options.

Example 15.1. Named Sequences

<?xml version="1.0"?>
<orm>
    <package name="org.mag">
        <sequence name="ArticleSeq" datastore-sequence="ART_SEQ"/> 
        ...
    </package>
    <package name="org.mag.pub">
        <sequence name="AuthorSeq" factory-class="Author$SequenceFactory"/>
        ...
    </package>
    <package name="org.mag.subscribe">
        <sequence name="ContractSeq" strategy="transactional"/> 
        ...
    </package>
</orm>

 

Skip navigation bar   Back to Top