-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with collection elements not getting persisted
PostPosted: Fri Aug 04, 2006 5:42 pm 
Beginner
Beginner

Joined: Mon Apr 24, 2006 9:47 pm
Posts: 33
Location: Kansas City, MO
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.2

Mapping documents: Lead.hbm.xml, LeadLocation.hbm.xml

Lead.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.nkics.socialworkprn.swan.domain.Lead" table="LEAD">
        <id name="id" type="int">
            <column name="LEAD_ID" />
            <generator class="native" />
        </id>
        <one-to-one name="primaryLeadLocation" cascade="all" />
        <many-to-one name="leadSource" class="com.nkics.socialworkprn.swan.domain.LeadSource" fetch="select" lazy="false">
            <column name="LEAD_SOURCE_ID" />
        </many-to-one>
        <many-to-one name="leadType" class="com.nkics.socialworkprn.swan.domain.LeadType" fetch="select" lazy="false">
            <column name="LEAD_TYPE_ID" not-null="true" />
        </many-to-one>
        <many-to-one name="office" class="com.nkics.socialworkprn.swan.domain.Office" fetch="select">
            <column name="OFFICE_ID" not-null="true" />
        </many-to-one>
        <property name="active" type="boolean">
            <column name="LEAD_ACTIVE" not-null="true" />
        </property>
        <property name="name" type="string">
            <column name="LEAD_NAME" length="40" not-null="true" />
        </property>
        <property name="gsaSigned" type="timestamp">
            <column name="LEAD_GSA_SIGNED" length="23" />
        </property>
        <property name="vendorAgreement" type="boolean">
            <column name="LEAD_VENDOR_AGREEMENT" not-null="true" />
        </property>
        <property name="requirementsNote" type="string">
            <column name="LEAD_REQUIREMENTS_NOTE" length="2000" />
        </property>
        <property name="generalNote" type="string">
            <column name="LEAD_GENERAL_NOTE" length="2000" />
        </property>
        <property name="leadCreated" type="timestamp">
            <column name="LEAD_CREATED" length="23" not-null="true" />
        </property>
        <property name="leadUpdated" type="timestamp">
            <column name="LEAD_UPDATED" length="23" />
        </property>
        <set name="leadLocations" inverse="true">
            <key>
                <column name="LEAD_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.LeadLocation" />
        </set>
       <joined-subclass name="com.nkics.socialworkprn.swan.domain.Client" table="CLIENT">
         <key column="LEAD_ID" />
           <property name="clientCreated" type="timestamp">
               <column name="CLIENT_CREATED" length="23" not-null="true" />
           </property>
       </joined-subclass>
    </class>
</hibernate-mapping>


LeadLocation.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.nkics.socialworkprn.swan.domain.LeadLocation" table="LEAD_LOCATION">
        <id name="id" type="int">
            <column name="LEAD_LOCATION_ID" />
            <generator class="native" />
        </id>
        <many-to-one name="lead" class="com.nkics.socialworkprn.swan.domain.Lead" fetch="select">
            <column name="LEAD_ID" not-null="true" />
        </many-to-one>
        <many-to-one name="state" class="com.nkics.socialworkprn.swan.domain.State" fetch="select">
            <column name="STATE_ID" not-null="true" />
        </many-to-one>
        <property name="active" type="boolean">
           <column name="LEAD_LOCATION_ACTIVE" not-null="true" />
        </property>
        <property name="addressLine1" type="string">
            <column name="LEAD_LOCATION_ADDRESS_LINE1" length="128" not-null="true" />
        </property>
        <property name="addressLine2" type="string">
            <column name="LEAD_LOCATION_ADDRESS_LINE2" length="128" />
        </property>
        <property name="city" type="string">
            <column name="LEAD_LOCATION_ADDRESS_CITY" length="128" not-null="true" />
        </property>
        <property name="zip5" type="string">
            <column name="LEAD_LOCATION_ADDRESS_ZIP5" length="5" not-null="true" />
        </property>
        <property name="zip4" type="string">
            <column name="LEAD_LOCATION_ADDRESS_ZIP4" length="4" />
        </property>
        <set name="leadContacts" inverse="true">
            <key>
                <column name="LEAD_LOCATION_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.LeadContact" />
        </set>
      <set name="requisitions" inverse="true">
         <key>
            <column name="LEAD_LOCATION_ID" not-null="true" />
         </key>
         <one-to-many class="com.nkics.socialworkprn.swan.domain.Requisition" />
      </set>
   </class>
</hibernate-mapping>


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

Code:
Lead lead = new Lead();
lead.setActive(leadDTO.getActive());
lead.setGeneralNote(leadDTO.getGeneralNote());
lead.setGsaSigned(leadDTO.getGsaSigned());
for(LeadLocationDTO leadLocationDTO : leadDTO.getLeadLocationDTOs())
{
   LeadLocation leadLocation = new LeadLocation();
   leadLocation.setActive(leadLocationDTO.getActive());
   leadLocation.setAddressLine1(leadLocationDTO.getAddressLine1());
   leadLocation.setAddressLine2(leadLocationDTO.getAddressLine2());
   leadLocation.setCity(leadLocationDTO.getCity());
   for(LeadContactDTO leadContactDTO : leadLocationDTO.getLeadContactDTOs())
   {
      LeadContact leadContact = new LeadContact();
      leadContact.setActive(leadContactDTO.getActive());
      leadContact.setDepartment(leadContactDTO.getDepartment());
      leadContact.setEmail(leadContactDTO.getEmail());
      leadContact.setFirstName(leadContactDTO.getFirstName());
      leadContact.setLastName(leadContactDTO.getLastName());
      leadContact.setLeadContactPrefix(new LeadContactPrefix());
      leadContact.getLeadContactPrefix().setId(leadContactDTO.getLeadContactPrefixDTO().getId());
      leadLocation.addLeadContact(leadContact);
   }
   leadLocation.setState(getStateDao().findById(leadLocationDTO.getStateDTO().getId()));
   leadLocation.setZip4(leadLocationDTO.getZip4());
   leadLocation.setZip5(leadLocationDTO.getZip5());
   lead.addLeadLocation(leadLocation);
}
lead.setLeadType(getLeadTypeDao().findById(leadDTO.getLeadTypeDTO().getId()));
lead.setName(leadDTO.getName());
lead.setOffice(getOfficeDao().findById(leadDTO.getOfficeDTO().getId()));
lead.setRequirementsNote(leadDTO.getRequirementsNote());
lead.setVendorAgreement(leadDTO.getVendorAgreement());

session.persist(lead);
      
if(leadDTO.getPrimaryLeadLocationDTO()!=null)
for(LeadLocation leadLocation : lead.getLeadLocations())
   if(leadDTO.getPrimaryLeadLocationDTO().getId().equals(leadLocation.getId()))
   {
      lead.setPrimaryLeadLocation(leadLocation);
      break;
   }


Full stack trace of any exception that occurs: No Exception. No Record is inserted into the LEAD_LOCATION table.

Name and version of the database you are using: MS SQL Server Desktop Edition 8.00.760 (SP3)

The generated SQL (show_sql=true):

Hibernate: select state0_.STATE_ID as STATE1_50_0_, state0_.STATE_ABBR as STATE2_50_0_, state0_.STATE_NAME as STATE3_50_0_ from STATE state0_ where state0_.STATE_ID=?
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select office0_.OFFICE_ID as OFFICE1_38_0_, office0_.STATE_ID as STATE2_38_0_, office0_.OFFICE_NAME as OFFICE3_38_0_, office0_.OFFICE_ADDRESS_LINE1 as OFFICE4_38_0_, office0_.OFFICE_ADDRESS_LINE2 as OFFICE5_38_0_, office0_.OFFICE_ADDRESS_CITY as OFFICE6_38_0_, office0_.OFFICE_ADDRESS_ZIP5 as OFFICE7_38_0_, office0_.OFFICE_ADDRESS_ZIP4 as OFFICE8_38_0_, office0_.OFFICE_EMAIL as OFFICE9_38_0_, office0_.OFFICE_DRIVING_DIRECTIONS as OFFICE10_38_0_ from OFFICE office0_ where office0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_ID as OFFICE2_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_27_0_, officephon0_.OFFICE_ID as OFFICE2_27_0_, officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE3_27_0_, officephon0_.OFFICE_PHONE_AREA_CODE as OFFICE4_27_0_, officephon0_.OFFICE_PHONE_SUFFIX as OFFICE5_27_0_, officephon0_.OFFICE_PHONE_PREFIX as OFFICE6_27_0_, officephon0_.OFFICE_PHONE_EXTENSION as OFFICE7_27_0_ from OFFICE_PHONE officephon0_ where officephon0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: insert into LEAD (LEAD_SOURCE_ID, LEAD_TYPE_ID, OFFICE_ID, LEAD_ACTIVE, LEAD_NAME, LEAD_GSA_SIGNED, LEAD_VENDOR_AGREEMENT, LEAD_REQUIREMENTS_NOTE, LEAD_GENERAL_NOTE, LEAD_CREATED, LEAD_UPDATED) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: select this_.LEAD_ID as LEAD1_46_1_, this_.LEAD_SOURCE_ID as LEAD2_46_1_, this_.LEAD_TYPE_ID as LEAD3_46_1_, this_.OFFICE_ID as OFFICE4_46_1_, this_.LEAD_ACTIVE as LEAD5_46_1_, this_.LEAD_NAME as LEAD6_46_1_, this_.LEAD_GSA_SIGNED as LEAD7_46_1_, this_.LEAD_VENDOR_AGREEMENT as LEAD8_46_1_, this_.LEAD_REQUIREMENTS_NOTE as LEAD9_46_1_, this_.LEAD_GENERAL_NOTE as LEAD10_46_1_, this_.LEAD_CREATED as LEAD11_46_1_, this_.LEAD_UPDATED as LEAD12_46_1_, this_1_.CLIENT_CREATED as CLIENT2_47_1_, case when this_1_.LEAD_ID is not null then 1 when this_.LEAD_ID is not null then 0 end as clazz_1_, leadlocati2_.LEAD_LOCATION_ID as LEAD1_29_0_, leadlocati2_.LEAD_ID as LEAD2_29_0_, leadlocati2_.STATE_ID as STATE3_29_0_, leadlocati2_.LEAD_LOCATION_ACTIVE as LEAD4_29_0_, leadlocati2_.LEAD_LOCATION_ADDRESS_LINE1 as LEAD5_29_0_, leadlocati2_.LEAD_LOCATION_ADDRESS_LINE2 as LEAD6_29_0_, leadlocati2_.LEAD_LOCATION_ADDRESS_CITY as LEAD7_29_0_, leadlocati2_.LEAD_LOCATION_ADDRESS_ZIP5 as LEAD8_29_0_, leadlocati2_.LEAD_LOCATION_ADDRESS_ZIP4 as LEAD9_29_0_ from LEAD this_ left outer join CLIENT this_1_ on this_.LEAD_ID=this_1_.LEAD_ID left outer join LEAD_LOCATION leadlocati2_ on this_.LEAD_ID=leadlocati2_.LEAD_LOCATION_ID where case when this_1_.LEAD_ID is not null then 1 when this_.LEAD_ID is not null then 0 end=? and (this_.LEAD_ACTIVE=?)
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select office0_.OFFICE_ID as OFFICE1_38_0_, office0_.STATE_ID as STATE2_38_0_, office0_.OFFICE_NAME as OFFICE3_38_0_, office0_.OFFICE_ADDRESS_LINE1 as OFFICE4_38_0_, office0_.OFFICE_ADDRESS_LINE2 as OFFICE5_38_0_, office0_.OFFICE_ADDRESS_CITY as OFFICE6_38_0_, office0_.OFFICE_ADDRESS_ZIP5 as OFFICE7_38_0_, office0_.OFFICE_ADDRESS_ZIP4 as OFFICE8_38_0_, office0_.OFFICE_EMAIL as OFFICE9_38_0_, office0_.OFFICE_DRIVING_DIRECTIONS as OFFICE10_38_0_ from OFFICE office0_ where office0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_ID as OFFICE2_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_27_0_, officephon0_.OFFICE_ID as OFFICE2_27_0_, officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE3_27_0_, officephon0_.OFFICE_PHONE_AREA_CODE as OFFICE4_27_0_, officephon0_.OFFICE_PHONE_SUFFIX as OFFICE5_27_0_, officephon0_.OFFICE_PHONE_PREFIX as OFFICE6_27_0_, officephon0_.OFFICE_PHONE_EXTENSION as OFFICE7_27_0_ from OFFICE_PHONE officephon0_ where officephon0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: select office0_.OFFICE_ID as OFFICE1_38_0_, office0_.STATE_ID as STATE2_38_0_, office0_.OFFICE_NAME as OFFICE3_38_0_, office0_.OFFICE_ADDRESS_LINE1 as OFFICE4_38_0_, office0_.OFFICE_ADDRESS_LINE2 as OFFICE5_38_0_, office0_.OFFICE_ADDRESS_CITY as OFFICE6_38_0_, office0_.OFFICE_ADDRESS_ZIP5 as OFFICE7_38_0_, office0_.OFFICE_ADDRESS_ZIP4 as OFFICE8_38_0_, office0_.OFFICE_EMAIL as OFFICE9_38_0_, office0_.OFFICE_DRIVING_DIRECTIONS as OFFICE10_38_0_ from OFFICE office0_ where office0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_ID as OFFICE2_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_27_0_, officephon0_.OFFICE_ID as OFFICE2_27_0_, officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE3_27_0_, officephon0_.OFFICE_PHONE_AREA_CODE as OFFICE4_27_0_, officephon0_.OFFICE_PHONE_SUFFIX as OFFICE5_27_0_, officephon0_.OFFICE_PHONE_PREFIX as OFFICE6_27_0_, officephon0_.OFFICE_PHONE_EXTENSION as OFFICE7_27_0_ from OFFICE_PHONE officephon0_ where officephon0_.OFFICE_ID=?

Debug level Hibernate log excerpt:

[code]
2006-08-04 16:19:02,981 DEBUG [com.nkics.socialworkprn.swan.mvc.client.CreateLeadController] - Removing form session attribute [com.nkics.socialworkprn.swan.mvc.client.CreateLeadController.FORM.leadForm]
2006-08-04 16:19:02,981 DEBUG [com.nkics.socialworkprn.swan.mvc.client.CreateLeadController] - No errors -> processing submit
2006-08-04 16:19:02,981 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 4729759100850176
2006-08-04 16:19:02,981 DEBUG [org.hibernate.transaction.JDBCTransaction] - begin
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.ConnectionManager] - opening JDBC connection
2006-08-04 16:19:02,981 DEBUG [org.hibernate.transaction.JDBCTransaction] - current autocommit status: true
2006-08-04 16:19:02,981 DEBUG [org.hibernate.transaction.JDBCTransaction] - disabling autocommit
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction begin
2006-08-04 16:19:02,981 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateStateDao] - getting State instance with id: 10
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - object not resolved in any cache: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Fetching entity: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - loading entity: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.SQL] - select state0_.STATE_ID as STATE1_50_0_, state0_.STATE_ABBR as STATE2_50_0_, state0_.STATE_NAME as STATE3_50_0_ from STATE state0_ where state0_.STATE_ID=?
Hibernate: select state0_.STATE_ID as STATE1_50_0_, state0_.STATE_ABBR as STATE2_50_0_, state0_.STATE_NAME as STATE3_50_0_ from STATE state0_ where state0_.STATE_ID=?
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,981 DEBUG [org.hibernate.type.IntegerType] - binding '10' to parameter: 1
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.type.StringType] - returning 'FL' as column: STATE2_50_0_
2006-08-04 16:19:02,981 DEBUG [org.hibernate.type.StringType] - returning 'FlorIDa' as column: STATE3_50_0_
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - done processing result set (1 rows)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 1
2006-08-04 16:19:02,981 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.State#10]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - initializing non-lazy collections
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - done entity load
2006-08-04 16:19:02,981 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateStateDao] - get successful, instance found
2006-08-04 16:19:02,981 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateLeadTypeDao] - getting LeadType instance with id: 2
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - object not resolved in any cache: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Fetching entity: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.loader.Loader] - loading entity: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,981 DEBUG [org.hibernate.SQL] - select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
Hibernate: select leadtype0_.LEAD_TYPE_ID as LEAD1_48_0_, leadtype0_.LEAD_TYPE_NAME as LEAD2_48_0_, leadtype0_.LEAD_TYPE_DESCRIPTION as LEAD3_48_0_ from LEAD_TYPE leadtype0_ where leadtype0_.LEAD_TYPE_ID=?
2006-08-04 16:19:02,981 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - binding '2' to parameter: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Medical-Acute' as column: LEAD2_48_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Medical acute care, sub-acute, Skilled Nursing Unit' as column: LEAD3_48_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done processing result set (1 rows)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.LeadType#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - initializing non-lazy collections
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done entity load
2006-08-04 16:19:02,997 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateLeadTypeDao] - get successful, instance found
2006-08-04 16:19:02,997 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateOfficeDao] - getting Office instance with id: 2
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - object not resolved in any cache: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Fetching entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.SQL] - select office0_.OFFICE_ID as OFFICE1_38_0_, office0_.STATE_ID as STATE2_38_0_, office0_.OFFICE_NAME as OFFICE3_38_0_, office0_.OFFICE_ADDRESS_LINE1 as OFFICE4_38_0_, office0_.OFFICE_ADDRESS_LINE2 as OFFICE5_38_0_, office0_.OFFICE_ADDRESS_CITY as OFFICE6_38_0_, office0_.OFFICE_ADDRESS_ZIP5 as OFFICE7_38_0_, office0_.OFFICE_ADDRESS_ZIP4 as OFFICE8_38_0_, office0_.OFFICE_EMAIL as OFFICE9_38_0_, office0_.OFFICE_DRIVING_DIRECTIONS as OFFICE10_38_0_ from OFFICE office0_ where office0_.OFFICE_ID=?
Hibernate: select office0_.OFFICE_ID as OFFICE1_38_0_, office0_.STATE_ID as STATE2_38_0_, office0_.OFFICE_NAME as OFFICE3_38_0_, office0_.OFFICE_ADDRESS_LINE1 as OFFICE4_38_0_, office0_.OFFICE_ADDRESS_LINE2 as OFFICE5_38_0_, office0_.OFFICE_ADDRESS_CITY as OFFICE6_38_0_, office0_.OFFICE_ADDRESS_ZIP5 as OFFICE7_38_0_, office0_.OFFICE_ADDRESS_ZIP4 as OFFICE8_38_0_, office0_.OFFICE_EMAIL as OFFICE9_38_0_, office0_.OFFICE_DRIVING_DIRECTIONS as OFFICE10_38_0_ from OFFICE office0_ where office0_.OFFICE_ID=?
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - binding '2' to parameter: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '26' as column: STATE2_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Nicholson Kovac KC' as column: OFFICE3_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '600 Broadway' as column: OFFICE4_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE5_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Kansas City' as column: OFFICE6_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '64105' as column: OFFICE7_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE8_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'info@nicholsonkovac.com' as column: OFFICE9_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE10_38_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done processing result set (1 rows)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.State#26]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - creating new proxy for entity
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - creating collection wrapper:[com.nkics.socialworkprn.swan.domain.Office.leads#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - creating collection wrapper:[com.nkics.socialworkprn.swan.domain.Office.meetings#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - creating collection wrapper:[com.nkics.socialworkprn.swan.domain.Office.officeActivities#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - creating collection wrapper:[com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - creating collection wrapper:[com.nkics.socialworkprn.swan.domain.Office.resources#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - initializing non-lazy collections
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener] - initializing collection [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener] - checking second-level cache
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener] - collection not cached
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - loading collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.SQL] - select officephon0_.OFFICE_ID as OFFICE2_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_27_0_, officephon0_.OFFICE_ID as OFFICE2_27_0_, officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE3_27_0_, officephon0_.OFFICE_PHONE_AREA_CODE as OFFICE4_27_0_, officephon0_.OFFICE_PHONE_SUFFIX as OFFICE5_27_0_, officephon0_.OFFICE_PHONE_PREFIX as OFFICE6_27_0_, officephon0_.OFFICE_PHONE_EXTENSION as OFFICE7_27_0_ from OFFICE_PHONE officephon0_ where officephon0_.OFFICE_ID=?
Hibernate: select officephon0_.OFFICE_ID as OFFICE2_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_1_, officephon0_.OFFICE_PHONE_ID as OFFICE1_27_0_, officephon0_.OFFICE_ID as OFFICE2_27_0_, officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE3_27_0_, officephon0_.OFFICE_PHONE_AREA_CODE as OFFICE4_27_0_, officephon0_.OFFICE_PHONE_SUFFIX as OFFICE5_27_0_, officephon0_.OFFICE_PHONE_PREFIX as OFFICE6_27_0_, officephon0_.OFFICE_PHONE_EXTENSION as OFFICE7_27_0_ from OFFICE_PHONE officephon0_ where officephon0_.OFFICE_ID=?
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - binding '2' to parameter: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set contains (possibly empty) collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - uninitialized collection: initializing
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '1' as column: OFFICE1_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '1' as column: OFFICE3_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '816' as column: OFFICE4_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '8881' as column: OFFICE5_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '842' as column: OFFICE6_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE7_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - found row of collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - reading row
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '1' as column: OFFICE1_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE1_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '3' as column: OFFICE3_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '816' as column: OFFICE4_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '1156' as column: OFFICE5_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '842' as column: OFFICE6_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE7_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - found row of collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - reading row
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE1_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 2
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '3' as column: OFFICE1_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '1' as column: OFFICE3_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '816' as column: OFFICE4_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '8881' as column: OFFICE5_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '842' as column: OFFICE6_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE7_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - found row of collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - reading row
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '3' as column: OFFICE1_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 3
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '4' as column: OFFICE1_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '3' as column: OFFICE3_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '816' as column: OFFICE4_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '1156' as column: OFFICE5_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning '842' as column: OFFICE6_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning null as column: OFFICE7_27_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '2' as column: OFFICE2_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - found row of collection: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.CollectionLoadContext] - reading row
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - returning '4' as column: OFFICE1_1_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done processing result set (4 rows)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 4
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - entity found in session cache
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - object not resolved in any cache: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Fetching entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.SQL] - select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - binding '1' to parameter: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Main' as column: OFFICE2_54_0_
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done processing result set (1 rows)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - done entity load
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhone#1]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - entity found in session cache
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - object not resolved in any cache: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Fetching entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.SQL] - select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
Hibernate: select officephon0_.OFFICE_PHONE_TYPE_ID as OFFICE1_54_0_, officephon0_.OFFICE_PHONE_TYPE_NAME as OFFICE2_54_0_ from OFFICE_PHONE_TYPE officephon0_ where officephon0_.OFFICE_PHONE_TYPE_ID=?
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.IntegerType] - binding '3' to parameter: 1
2006-08-04 16:19:02,997 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - processing result set
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result set row: 0
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - result row: EntityKey[com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.loader.Loader] - Initializing object from ResultSet: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Hydrating entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:02,997 DEBUG [org.hibernate.type.StringType] - returning 'Fax' as column: OFFICE2_54_0_
2006-08-04 16:19:03,013 DEBUG [org.hibernate.loader.Loader] - done processing result set (1 rows)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:03,013 DEBUG [org.hibernate.loader.Loader] - total objects hydrated: 1
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.loader.Loader] - done entity load
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhone#2]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - entity found in session cache
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#1]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhone#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - resolving associations for [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.Office#2]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - entity found in session cache
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - loading entity: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - attempting to resolve: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultLoadEventListener] - resolved object in session cache: [com.nkics.socialworkprn.swan.domain.OfficePhoneType#3]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.TwoPhaseLoad] - done materializing entity [com.nkics.socialworkprn.swan.domain.OfficePhone#4]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.CollectionLoadContext] - 1 collections were found in result set for role: com.nkics.socialworkprn.swan.domain.Office.officePhones
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.CollectionLoadContext] - collection fully initialized: [com.nkics.socialworkprn.swan.domain.Office.officePhones#2]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.CollectionLoadContext] - 1 collections initialized for role: com.nkics.socialworkprn.swan.domain.Office.officePhones
2006-08-04 16:19:03,013 DEBUG [org.hibernate.loader.Loader] - done loading collection
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultInitializeCollectionEventListener] - collection initialized
2006-08-04 16:19:03,013 DEBUG [org.hibernate.loader.Loader] - done entity load
2006-08-04 16:19:03,013 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateOfficeDao] - get successful, instance found
2006-08-04 16:19:03,013 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateLeadDao] - persisting Lead instance
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - transient instance of: com.nkics.socialworkprn.swan.domain.Lead
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.DefaultPersistEventListener] - saving transient instance
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - saving [com.nkics.socialworkprn.swan.domain.Lead#<null>]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] - executing insertions
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.Cascade] - processing cascade ACTION_PERSIST for: com.nkics.socialworkprn.swan.domain.Lead
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.Cascade] - done processing cascade ACTION_PERSIST for: com.nkics.socialworkprn.swan.domain.Lead
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.WrapVisitor] - Wrapped collection in role: com.nkics.socialworkprn.swan.domain.Lead.leadLocations
2006-08-04 16:19:03,013 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Inserting entity: com.nkics.socialworkprn.swan.domain.Lead (native id)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to open PreparedStatement (open PreparedStatements: 0, globally: 1)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.SQL] - insert into LEAD (LEAD_SOURCE_ID, LEAD_TYPE_ID, OFFICE_ID, LEAD_ACTIVE, LEAD_NAME, LEAD_GSA_SIGNED, LEAD_VENDOR_AGREEMENT, LEAD_REQUIREMENTS_NOTE, LEAD_GENERAL_NOTE, LEAD_CREATED, LEAD_UPDATED) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into LEAD (LEAD_SOURCE_ID, LEAD_TYPE_ID, OFFICE_ID, LEAD_ACTIVE, LEAD_NAME, LEAD_GSA_SIGNED, LEAD_VENDOR_AGREEMENT, LEAD_REQUIREMENTS_NOTE, LEAD_GENERAL_NOTE, LEAD_CREATED, LEAD_UPDATED) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - preparing statement
2006-08-04 16:19:03,013 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] - Dehydrating entity: [com.nkics.socialworkprn.swan.domain.Lead#<null>]
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.IntegerType] - binding null to parameter: 1
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.IntegerType] - binding '2' to parameter: 2
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.IntegerType] - binding '2' to parameter: 3
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.BooleanType] - binding 'true' to parameter: 4
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.StringType] - binding 'Test 6' to parameter: 5
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 6
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.BooleanType] - binding 'true' to parameter: 7
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 8
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.StringType] - binding null to parameter: 9
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.TimestampType] - binding '2006-08-04 16:19:02' to parameter: 10
2006-08-04 16:19:03,013 DEBUG [org.hibernate.type.TimestampType] - binding null to parameter: 11
2006-08-04 16:19:03,013 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] - Natively generated identity: 16
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - about to close PreparedStatement (open PreparedStatements: 1, globally: 2)
2006-08-04 16:19:03,013 DEBUG [org.hibernate.jdbc.AbstractBatcher] - closing statement
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.Cascade] - processing cascade ACTION_PERSIST for: com.nkics.socialworkprn.swan.domain.Lead
2006-08-04 16:19:03,013 DEBUG [org.hibernate.engine.Cascade] - done processing cascade ACTION_PERSIST for: com.nkics.socialworkprn.swan.domain.Lead
2006-08-04 16:19:03,013 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateLeadDao] - persist successful
2006-08-04 16:19:03,013 DEBUG [org.hibernate.transaction.JDBCTransaction] - commit
2006-08-04 16:19:03,013 DEBUG [org.hibernate.impl.SessionImpl] - automatically flushing session
2006-08-04 16:19:03,013 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] - flushing session
2006-08-04 16:19:03,0


Top
 Profile  
 
 Post subject: Re: Problem with collection elements not getting persisted
PostPosted: Sat Aug 05, 2006 5:13 am 
Beginner
Beginner

Joined: Thu Jul 20, 2006 12:08 pm
Posts: 21
Location: Germany
stevewickii wrote:


Debug level Hibernate log excerpt:

....
[org.hibernate.transaction.JDBCTransaction] - current autocommit status: true
2006-08-04 16:19:02,981 DEBUG [org.hibernate.transaction.JDBCTransaction] - disabling autocommit
....
2006-08-04 16:19:03,013 DEBUG [org.hibernate.transaction.JDBCTransaction] - commit


Hi,

i can´t see an explicit commit in your session. the autocommit has been disabled. but i don´t know why the log says 'commit'.

i would try the source again with an explicit commit in an transaction.

greetz

marlon

_________________
marlon
---
don't hesitate to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 11:15 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 9:47 pm
Posts: 33
Location: Kansas City, MO
The transaction is handled by Spring.

Exerpt from applicationContext.xml:
Code:
   <bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource">
         <ref local="dataSource" />
      </property>
      <property name="mappingResources">
         <list>
              <value>com/nkics/socialworkprn/swan/persistence/hibernate/Lead.hbm.xml</value>
                            <value>com/nkics/socialworkprn/swan/persistence/hibernate/LeadLocation.hbm.xml</value>
              </list>
      </property>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.query.substitutions">true=1 false=0</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
         </props>
      </property>
   </bean>

   <bean id="transactionManager"
      class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      <property name="sessionFactory">
         <ref local="sessionFactory" />
      </property>
   </bean>

   <bean id="leadServiceTarget" class="com.nkics.socialworkprn.swan.service.defaults.DefaultLeadService">
        <property name="leadDao"><ref bean="leadDao" /></property>
        <property name="leadTypeDao"><ref bean="leadTypeDao" /></property>
        <property name="officeDao"><ref bean="officeDao"/></property>
        <property name="stateDao"><ref bean="stateDao"/></property>
    </bean>

   <bean id="leadService"
      class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
      <property name="target">
         <ref bean="leadServiceTarget" />
      </property>
      <property name="transactionManager">
         <ref bean="transactionManager" />
      </property>
      <property name="transactionAttributes">
         <props>
            <prop key="*">PROPAGATION_REQUIRED, ISOLATION_DEFAULT</prop>
         </props>
      </property>
   </bean>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 11:44 am 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
modify your set element to include cascade="all-delete-orphan"

for example,
Code:
<set name="leadContacts" inverse="true" cascade="all-delete-orphan">
   <key>
      <column name="LEAD_LOCATION_ID" not-null="true" />
   </key>
   <one-to-many class="com.nkics.socialworkprn.swan.domain.LeadContact" />
</set>


and also your code needs to be modified a little bit

Lead lead = new Lead();
lead.setActive(leadDTO.getActive());
lead.setGeneralNote(leadDTO.getGeneralNote());
lead.setGsaSigned(leadDTO.getGsaSigned());
for(LeadLocationDTO leadLocationDTO : leadDTO.getLeadLocationDTOs())
{
LeadLocation leadLocation = new LeadLocation();
leadLocation.setActive(leadLocationDTO.getActive());
leadLocation.setAddressLine1(leadLocationDTO.getAddressLine1());
leadLocation.setAddressLine2(leadLocationDTO.getAddressLine2());
leadLocation.setCity(leadLocationDTO.getCity());

for(LeadContactDTO leadContactDTO : leadLocationDTO.getLeadContactDTOs())
{
LeadContact leadContact = new LeadContact();
leadContact.setActive(leadContactDTO.getActive());
leadContact.setDepartment(leadContactDTO.getDepartment());
leadContact.setEmail(leadContactDTO.getEmail());
leadContact.setFirstName(leadContactDTO.getFirstName());
leadContact.setLastName(leadContactDTO.getLastName());
leadContact.setLeadContactPrefix(new LeadContactPrefix());
leadContact.getLeadContactPrefix().setId(leadContactDTO.getLeadContactPrefixDTO().getId());


leadContact.addLeadLocation( leadLocation );
leadLocation.getLeadContacts().add( leadContact );

}

leadLocation.setState(getStateDao().findById(leadLocationDTO.getStateDTO().getId()));
leadLocation.setZip4(leadLocationDTO.getZip4());
leadLocation.setZip5(leadLocationDTO.getZip5());


leadLocation.addLead( lead );
lead.getLeadLocations().add( leadLocation );

}

lead.setLeadType(getLeadTypeDao().findById(leadDTO.getLeadTypeDTO().getId()));
lead.setName(leadDTO.getName());
lead.setOffice(getOfficeDao().findById(leadDTO.getOfficeDTO().getId()));
lead.setRequirementsNote(leadDTO.getRequirementsNote());
lead.setVendorAgreement(leadDTO.getVendorAgreement());

session.persist(lead);

if(leadDTO.getPrimaryLeadLocationDTO()!=null)
for(LeadLocation leadLocation : lead.getLeadLocations())
if(leadDTO.getPrimaryLeadLocationDTO().getId().equals(leadLocation.getId()))
{
lead.setPrimaryLeadLocation(leadLocation);
break;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.