[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2916) Native Sequence Usage

Jigar Sutaria (JIRA) noreply at atlassian.com
Sun Oct 28 15:48:40 EDT 2007


Native Sequence Usage
---------------------

                 Key: HHH-2916
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2916
             Project: Hibernate3
          Issue Type: Improvement
          Components: core
    Affects Versions: 3.2.5
         Environment: Oracle
            Reporter: Jigar Sutaria
            Priority: Trivial


I tried this but I really couldnt figure out if this can be done or not. Consider the following case

1. There is a Master detail Relation
2. Primary key in master table is generated using sequence
3. This generated id will also be used in detail table

In order to do above scenario, I have to take following steps (Correct me id I am wrong)

1.  Bean Mapped to Master table needs to be saved first
2. Put any query to get primary key generated while above save operation using other data field of the table
3. Populate your Master bean with primary key
4. Set the primary key in all the details that needs to be saved

Now, here I can see over head of one query (Step 2)  just because we are not populating our bean with primary key while persisting it.
By any mechanism if hibernate saves the primary key value in the associated bean after querying (SELECT seq.nextval from dual) then
Step 2 can be avoided.






-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list