-->
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: save(object) Not using stored procedure
PostPosted: Mon Jul 16, 2007 4:45 pm 
Newbie

Joined: Mon Mar 26, 2007 12:47 am
Posts: 2
Location: Plano, Texas
Hibernate version:3.2.1.ga

Mapping documents:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
   
<hibernate-mapping package="com.countrywide.loanadmin.ace.creditreporting.cushionpolicy.domain">
   <class name="AuditLogImpl" table="MET2DLOGF0">
      <id name="id" column="ID" type="long" access="field">
         <generator class="native"/>
      </id>
      <property name="customerAccountNumber"      column="ACCTNUM"    type="long"       access="field"/>
      <property name="reportingPeriodDate"        column="RPTPER"    type="long"       access="field"/>
      <property name="orgMostRecentPaymentRating" column="ORGPRAT"    type="string"       access="field"/>
      <property name="chgMostRecentPaymentRating" column="CHGPRAT"    type="string"       access="field"/>
      <property name="orgAccountStatus"           column="ORGSTAT"    type="string"       access="field"/>
      <property name="chgAccountStatus"           column="CHGSTAT"    type="string"       access="field"/>
      <property name="orgPastDueAmount"           column="ORGPSDU"    type="big_decimal"    access="field"/>
      <property name="chgPastDueAmount"           column="CHGPSDU"      type="big_decimal"    access="field"/>
      <property name="orgFcraDate"                column="ORGFCRA"    type="string"       access="field"/>
      <property name="chgFcraDate"                column="CHGFCRA"    type="string"       access="field"/>
      <property name="dateUpdated"                column="LSTCHGDTTM" type="calendar"    access="field"/>
      <property name="updatedBy"                  column="LSTCHGUSER" type="string"       access="field"/>
      <sql-insert callable="true" check="none">
      { call ACESP5(?,?,?,?,?,?,?,?,?,?,?,?) }
      </sql-insert>
   </class>
</hibernate-mapping>



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

(Long)sessionFactory.getCurrentSession().save(auditLog);


Name and version of the database you are using:
as400 database V5R3
Code:
<bean id="dataSource"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
      <property name="driverClassName" value="com.ibm.as400.access.AS400JDBCDriver" />
       <property name="url" value="jdbc:as400://AS400DEV;naming=system;" />
        <property name="username" value="tosborne" />
        <property name="password" value="xxxxxxxxxx" /> 
   </bean>




When I look at the log files, it shows Hibernate performing it's own INSERT statement instead of calling my stored procedure.


I read the chapter 8 page 361 in the Java Persistance with Hibernate(great book by the way).

Am I missing something?


Top
 Profile  
 
 Post subject: Slight Modifaction to generator value
PostPosted: Wed Aug 01, 2007 3:30 pm 
Newbie

Joined: Mon Mar 26, 2007 12:47 am
Posts: 2
Location: Plano, Texas
My team referenced the Hiberate Reference PDF and in Section 16.3 we noticed that the example uses the generator class="increment".

Now, no where in that PDF does it show when/why to use "increment".

We took a best guess and got an example to work.


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.