Solved

how to use Oracle sequence in Hibernate;

Posted on 2007-03-21
1
10,067 Views
Last Modified: 2013-11-24
i have a sequence created in Oracle;how to use this sequence in Hibernate;i think we have to declare in mapping file;how to declare?



select seq_emp_master.nextval from dual
0
Comment
Question by:chaitu chaitu
1 Comment
 
LVL 10

Accepted Solution

by:
Jaax earned 500 total points
ID: 18762383
In the hibernate mapping file you should define something like this :
        <id
            name="primaryKeyId"
            column="PRIMARYKEYID"
            type="java.lang.Long"
            unsaved-value="null"
        >
            <generator class="sequence">
                <param name="sequence">NAME_OF_THE_PRIM_KEY_SEQ</param>
            </generator>
        </id>
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 73
GUI builder for Eclipse? 8 27
stackato and cloud 4 69
rhino JavaScript import, load 25 67
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now