Hi Christian, I guess I am not explaining myself clearly. Hibernate fixes extremely well in the whole application except for the following part. Here is the problem:
One of the functionalities of my application is allowing users to reduce a set of data from certain tables in the database. The application administrators choose what tables they want to involve in the reductions during setup and users can use our user interface chooses what fields and values they want them to get involve with the reduction. The users can create numerious reductions through our interface. The next step is translating all these inputs into various select SQL queries and move the returning data to a system data for future processing. The problem I have right now is that when I am using Hibernate functionality, I need to perform a session.find(select query) to load all the select data first, and then generates individual session.save for individual object returns from session.find into the system table. This is extremely expensive because my select query might involve more than 1 million records sometime. I want to know is there ANY way that I don't need to select out the data through session.find and save individual data through session.save into the system table. I know in SQL you can perform insert into table1 (v1, v2) values (?, ?) select v4, v5 from table4, table5 where table4.id = table5.id and table4.v6=1 and table5.v7=2 which I don't need to extract the data out from the database and insert into the system table. I wonder if Hibernate has a similar solution so that the application does not need to extract out data from database before inserting into another table. I am very close to my deadline and this is something I need to solve rather quickly. Could you give me some pointers on this issue?? Thanks. Vivian Fonger Software Engineer Socketware [EMAIL PROTECTED] -----Original Message----- From: Christian Bauer [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 10:11 AM To: Vivian Fonger Cc: [EMAIL PROTECTED] Subject: Re: [Hibernate] Urgent - Is this possible through hibernate?? On 19 Nov (10:02), Vivian Fonger wrote: > Can someone give me some good suggestions on how to perform an > efficient insert-select through using hibernate?? I don't want to use > straight SQL because my application will support multiple database and > I don't want to create individual SQL for each platform plus the > insert-select statement changes according to user request. What is the > best way to do an efficient insert-select by using Hibernate to > simulate something like the following SQL statement without using > static SQL: You need an SQL abstraction layer and propably not a full object/relational mapping tool. -- Christian Bauer [EMAIL PROTECTED] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel