-->
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: Is there a way to bulk insert in Hibernate 3.0.5?
PostPosted: Wed Nov 09, 2005 2:25 pm 
Beginner
Beginner

Joined: Thu Oct 13, 2005 3:40 pm
Posts: 29
I would like to do a bulk insert for a table called TM_DETAIL with a sub-select. The POJO class is TmDetail. Below is the SQL for it.

Thanks!
Atul

Code:
INSERT INTO TM_DETAIL
(
      TM_DETAIL_ID,
      TEAM_ID,
      PERSON_ID,
      FISCAL_PERIOD_ID,
      TM_LEVEL_CODE_PP1,
      PAY_STATUS_CODE_PP1,
      WORK_LEVEL_CODE_PP1,
      REG_LABOR_HOURS_PP1,
      OT_LABOR_HOURS_PP1,
      BASE_HOURLY_WAGE_PP1,
      OTHER_EARNINGS_PP1,
      OTHER_EARNINGS_DESC_PP1,
      TM_LEVEL_CODE_PP2,
      PAY_STATUS_CODE_PP2,
      WORK_LEVEL_CODE_PP2,
      REG_LABOR_HOURS_PP2,
      OT_LABOR_HOURS_PP2,
      BASE_HOURLY_WAGE_PP2,
      OTHER_EARNINGS_PP2,
      OTHER_EARNINGS_DESC_PP2,
      LABOR_SURPLUS_PAYOUT,
      OT_ADJ_PAYOUT,
      POOL_PAYOUT,
      POOL_OT_ADJ_PAYOUT,
      MODIFIED_BY,
      MODIFIED_DT,
      CREATED_BY,
      CREATED_DT,
      FROM_TEAM_ID
)
SELECT
      TM_DETAIL_SEQ.NEXTVAL,
      5,
      td.PERSON_ID,
      td.FISCAL_PERIOD_ID,
      td.TM_LEVEL_CODE_PP1,
      td.PAY_STATUS_CODE_PP1,
      td.WORK_LEVEL_CODE_PP1,
      td.REG_LABOR_HOURS_PP1,
      td.OT_LABOR_HOURS_PP1,
      td.BASE_HOURLY_WAGE_PP1,
      td.OTHER_EARNINGS_PP1,
      td.OTHER_EARNINGS_DESC_PP1,
      td.TM_LEVEL_CODE_PP2,
      td.PAY_STATUS_CODE_PP2,
      td.WORK_LEVEL_CODE_PP2,
      td.REG_LABOR_HOURS_PP2,
      td.OT_LABOR_HOURS_PP2,
      td.BASE_HOURLY_WAGE_PP2,
      td.OTHER_EARNINGS_PP2,
      td.OTHER_EARNINGS_DESC_PP2,
      td.LABOR_SURPLUS_PAYOUT,
      td.OT_ADJ_PAYOUT,
      td.POOL_PAYOUT,
      td.POOL_OT_ADJ_PAYOUT,
      td.MODIFIED_BY,
      td.MODIFIED_DT,
      td.CREATED_BY,
      td.CREATED_DT,
      td.TEAM_ID
FROM
    TM_DETAIL td
WHERE
     AND t.TEAM_ID IN (1, 2, 4);

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 5:32 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
use pure jdbc


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.