-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to perform a native SQL operation?
PostPosted: Thu Apr 14, 2005 3:32 pm 
Newbie

Joined: Mon Apr 04, 2005 7:33 pm
Posts: 3
The situation comes about while transferring data from some legacy tables to a new set of tables created to take advantage of hibernate's object relationships. The legacy data is being brought into the program usig standard JDBC. The new tables are being established using Hibernate.

The particular situation is a parts list which would normally have an index to facilitate access to the part. The presence of the index makes the initial load of the 80,000 parts intollerably slow, so the table is initially created without the index.

On the next phase of the load program, when the children of the part are loaded, the index needs to be established. I want to execute a table alteration:

Quote:
ALTER TABLE PART ADD CONSTRAINT PART_IX UNIQUE (PARTNUMBER, VENDOR_ID)


While I could get a separate connection to perform this operation, is there a way to get to Hibernate's connection to perform the JDBC execute?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 15, 2005 1:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
did you try and look in the docs ? It's mentioned about 5 to 6 places that session.connection() should be used for this.

/max

_________________
Max
Don't forget to rate


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

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.