是否可以在不使用休眠的情况下传输批量数据。用jpa,

时间:2016-03-09 12:49:04

标签: java hibernate jpa

    jdbcTemplate.query("select * from MISDailyCandidateInfo", new RowCallbackHandler() {
        @Override
        public void processRow(ResultSet rs) throws SQLException {
            JdbcTemplate jdbcTemplateMettl = daoFactory.getJDBCTemplateMettl();
            String sql = "insert into TempDailyNDLMCandidatesData (email_id, invitation_id, assessment_id, candidate_reg_id, candidate_context_data)"
                    + " values (?, ?, ?, ?, ?)";
            while (rs.next()) {
                String emailID = rs.getString("email_id");
                String invitationKey = rs.getString("invitation_key");
                int assessmentID = rs.getInt("assessment_id");
                int candidateRegistrationID = rs.getInt("candidate_reg_id");
                String candidate_context_data = rs.getString("candidate_context_data");
                List<Object[]> params = new ArrayList<Object[]>();
                params.add(new Object[]{emailID,
                        invitationKey,
                        assessmentID,
                        candidateRegistrationID,
                        candidate_context_data});
                jdbcTemplateMettl.batchUpdate(sql, params);
            }

        }

});

  1. 我使用jdbc将数据从数据源传输到另一个数据源它需要花费太多时间是否有可能在不使用模型和hibernet的情况下传输jpa的批量数据传输

0 个答案:

没有答案