|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| DeliveryDocketItem.java | 50% | 100% | 100% | 92,3% |
|
||||||||||||||
| 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 | 128 | public void setDeliveryDockets(Collection deliveryDockets) { |
| 36 | 128 | 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 | 704 | public Collection getDeliveryDockets() { |
| 47 | 704 | return deliveryDockets; |
| 48 | } | |
| 49 | ||
| 50 | /** | |
| 51 | * @return Returns the the latest version of the delivery docket. | |
| 52 | */ | |
| 53 | 1 | public DeliveryDocket getDeliveryDocket() { |
| 54 | 1 | Iterator iter = getDeliveryDockets().iterator(); |
| 55 | 1 | return iter.hasNext() ? (DeliveryDocket) iter.next() : null; |
| 56 | } | |
| 57 | ||
| 58 | /** | |
| 59 | * @param orderItems | |
| 60 | * The orderItems to set. | |
| 61 | */ | |
| 62 | 128 | public void setOrderItems(Collection orderItems) { |
| 63 | 128 | 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 | 703 | public Collection getOrderItems() { |
| 74 | 703 | return orderItems; |
| 75 | } | |
| 76 | ||
| 77 | } |
|
||||||||||