-->
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.  [ 1 post ] 
Author Message
 Post subject: Does creating polymorphc classes benefit INSERT performance?
PostPosted: Thu Jan 20, 2005 11:00 am 
Senior
Senior

Joined: Sun Oct 26, 2003 5:05 am
Posts: 139
In my application, I have to create 100's of Shipment objects upon request since the user can create sequences of Shipments before they are individual entered into the system. This is to help facilitate customs tracking in advance. However, when I create these new Shipment objects, I only need to set a few properties (the rest can be null). Considering the size of the Shipment mapping below, should I create another base class for Shipment (called ExpectedShipment or something) with just those properties that I'm going to set/query against? Will this improve creation performance? Thanks.

Code:
   <class name="com.borderconnect.domain.shipment.Shipment" table="shipment">
      <id name="id" column="id" type="long" unsaved-value="0">
         <generator class="sequence">
            <param name="sequence">rns_transaction_id_seq</param>
         </generator>
      </id>
      
      <component name="cargoControlNumber" class="com.borderconnect.domain.shipment.CargoControlNumber">
         <many-to-one name="carrierCode" column="carrier_code_id"
            class="com.borderconnect.domain.shipment.CarrierCode" cascade="save-update" />
         <property name="sequence" column="sequence" />
         <component name="parsPosition" class="com.borderconnect.domain.shipment.ParsPosition">
            <property name="name" column="pars_position"/>
         </component>
      </component>

      <property name="transactionNumber" column="transaction_number" />

      <many-to-one name="serviceOption" column="service_option_id" class="com.borderconnect.domain.shipment.ServiceOption" outer-join="false"  />
      <many-to-one name="releaseOffice" column="release_office_id" class="com.borderconnect.domain.shipment.ReleaseOffice" outer-join="false" />
      <many-to-one name="subLocation" column="sub_location_id"
         class="com.borderconnect.domain.shipment.SubLocation" outer-join="false"
         access="field" />
      <property name="containerNumber" column="container_number" />
      <bag name="statusMessages" table="shipment_status" inverse="true"
         order-by="date desc" cascade="save-update" outer-join="true" lazy="true">
         <key column="shipment_id"/>
         <one-to-many class="com.borderconnect.domain.shipment.ShipmentStatus" />
      </bag>
      <bag name="comments" table="shipment_comment" inverse="true"
         order-by="post_date asc" cascade="all-delete-orphan" outer-join="true" lazy="true">
         <key column="shipment_id"/>
         <one-to-many class="com.borderconnect.domain.shipment.ShipmentComment" />
      </bag>
      <many-to-one name="currentStatus" column="current_status_id"
         class="com.borderconnect.domain.shipment.ShipmentStatus"
         outer-join="false" access="field" />
      <many-to-one name="driver" column="driver_id"
         class="com.borderconnect.domain.Driver" />
      <many-to-one name="sequence" column="shipment_sequence_id"
         class="com.borderconnect.domain.shipment.sequence.Sequence" />
      <property name="isPurged" column="is_purged" />
   </class>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.