View Javadoc

1   /*
2    * Copyright 2004 Carlos Sanchez.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.oness.order.model.bo;
17  
18  import java.util.Collection;
19  import java.util.Iterator;
20  
21  /***
22   * @hibernate.class table="deliverydocketitem"
23   * 
24   * @author Carlos Sanchez
25   * @version $Revision: 1.6 $
26   */
27  public class DeliveryDocketItem extends Item {
28  
29      private Collection deliveryDockets, orderItems;
30  
31      /***
32       * @param deliveryDockets
33       *            The deliveryDockets to set.
34       */
35      public void setDeliveryDockets(Collection deliveryDockets) {
36          this.deliveryDockets = deliveryDockets;
37      }
38  
39      /***
40       * @hibernate.bag table="deliverydocket_deliverydocketitem" lazy="true" order-by="deliverydocket_id desc"
41       * @hibernate.collection-key column="deliverydocketitem_id"
42       * @hibernate.collection-many-to-many column="deliverydocket_id" class="net.sf.oness.order.model.bo.DeliveryDocket"
43       * 
44       * @return Returns the deliveryDockets.
45       */
46      public Collection getDeliveryDockets() {
47          return deliveryDockets;
48      }
49  
50      /***
51       * @return Returns the the latest version of the delivery docket.
52       */
53      public DeliveryDocket getDeliveryDocket() {
54          Iterator iter = getDeliveryDockets().iterator();
55          return iter.hasNext() ? (DeliveryDocket) iter.next() : null;
56      }
57  
58      /***
59       * @param orderItems
60       *            The orderItems to set.
61       */
62      public void setOrderItems(Collection orderItems) {
63          this.orderItems = orderItems;
64      }
65  
66      /***
67       * @hibernate.bag table="orderitem_deliverydocketitem" lazy="true" order-by="orderitem_id desc"
68       * @hibernate.collection-key column="deliverydocketitem_id"
69       * @hibernate.collection-many-to-many column="orderitem_id" class="net.sf.oness.order.model.bo.OrderItem"
70       * 
71       * @return Returns the orderItems.
72       */
73      public Collection getOrderItems() {
74          return orderItems;
75      }
76  
77  }