Announcement Announcement Module
Collapse
No announcement yet.
How to generate sequence number with composite PK? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to generate sequence number with composite PK?

    Hello,

    Does anyone know how I can set up my hibernate mapping file to genterate an Oracle sequence number when the I have a composite PK? From the example below I want to have the CITATION_NUMBER be generated.

    The equivalent sql would be: SELECT CITATION_SEQ.NEXTVAL FROM DUAL

    Code:
            
    <composite-id name="id" class="CitationId">
                <key-property name="caseUuid" type="string">
                    <column name="CASE_UUID" length="33" />
                </key-property>
                <key-property name="citationNumber" type="java.lang.Long">
                    <column name="CITATION_NUMBER" precision="12" scale="0" />
                </key-property>
            </composite-id>
    cheers
Working...
X