-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Changing the way Primary Keys are inserted into a table.
PostPosted: Thu Jul 10, 2008 6:37 am 
Newbie

Joined: Thu Aug 16, 2007 11:26 am
Posts: 3
Hibernate version:1.2.8

Database version:Oracle 10g

Dialect version:9i dialect

Is it possible to change the way inserts are made to tables so that whenever a insert is made to the table the insert should also contain the pimary key. However the primary keys are only set after the data has been inserted and by an Update. Please see description below.

I have three tables
Table A -- Table B -- Table C

Each table has a one to many relation ship. Table B references to A and Table C references to B.


Whenever i persist my object the Queries are executred are done in the following order.

for this example say each has one child.

    Get Sequence For Table A
    Get Sequence For Table B
    Get Sequence For Table C
    Insert NON PK Data Into Table A.
    Insert NON PK Data Into Table B.
    Insert NON PK Data Into Table C.
    Update Table B with PK Information ( contains a column for Referencing Table A)
    Update Table C with PK Information( contains a column for Referencing Table B)


i want this sql to look more like this.


    Get Sequence For Table A
    Get Sequence For Table B
    Get Sequence For Table C
    Insert ALL Data Into Table A.
    Insert ALL Data Into Table B.
    Insert ALL Data Into Table C.



Regards
Jai


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.