Solved

how to use Oracle sequence in Hibernate;

Posted on 2007-03-21
1
10,057 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

772 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

12 Experts available now in Live!

Get 1:1 Help Now