001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.geronimo.samples.daytrader.ejb; 018 019 020 import javax.ejb.*; 021 import java.math.BigDecimal; 022 import java.sql.Timestamp; 023 import org.apache.geronimo.samples.daytrader.*; 024 025 026 public interface LocalOrder extends EJBLocalObject { 027 028 029 /* Container persisted attributes 030 * Note: Commented out methods are internal only and not exposed to EJB clients 031 * For example: The Primary Key value cannot be modified after creation 032 * Also, modification of other Entity attributes may be restricted to internal use 033 */ 034 035 036 public Integer getOrderID(); /* orderID */ 037 //public void setOrderID(Integer accountID); 038 public String getOrderType(); /* orderType (buy, sell, etc.) */ 039 //public void setOrderType(String orderType); 040 public String getOrderStatus(); /* orderStatus (open, completed, etc.) */ 041 public void setOrderStatus(String orderType); 042 public Timestamp getOpenDate(); /* openDate (when the order was entered) */ 043 //public void setOpenDate(Date openDate); 044 public Timestamp getCompletionDate(); /* completionDate */ 045 public void setCompletionDate(Timestamp completionDate); 046 public double getQuantity(); /* quantity */ 047 //public void setQuantity(double quantity); 048 public BigDecimal getPrice(); /* price */ 049 //public void setPrice(BigDecimal price); 050 public BigDecimal getOrderFee(); /* price */ 051 //public void setOrderFee(BigDecimal price); 052 053 054 /* Accessor methods for relationship fields */ 055 public LocalAccount getAccount(); /* The account which placed the order */ 056 //public void setAccount(LocalAccount account); 057 public LocalQuote getQuote(); /* The stock purchased/sold in this order */ 058 //public void setQuote(LocalQuote quote); /* null for cash transactions */ 059 public LocalHolding getHolding(); /* The created/removed holding for this order */ 060 public void setHolding(LocalHolding holding); /* null for cash transactions */ 061 062 /* Business methods */ 063 public LocalHolding getHoldingForUpdate(); /* The holding for this order access with intent to update */ 064 public void cancel(); 065 066 public boolean isBuy(); 067 public boolean isSell(); 068 public boolean isOpen(); 069 public boolean isCompleted(); 070 public boolean isCancelled(); 071 072 public OrderDataBean getDataBean(); 073 public String toString(); 074 }