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    import javax.ejb.EJBHome;
020    import javax.ejb.CreateException;
021    import javax.ejb.FinderException;
022    import java.util.Collection;
023    import java.math.BigDecimal;
024    import java.rmi.Remote;
025    import java.rmi.RemoteException;
026    
027    public interface QuoteHome extends EJBHome, Remote {
028        
029        public Quote create (String symbol, String companyName, BigDecimal price)
030            throws CreateException, RemoteException;
031        
032        public Quote findByPrimaryKeyForUpdate (String symbol)
033            throws FinderException, RemoteException;
034    
035        public Quote findByPrimaryKey (String symbol)
036            throws FinderException, RemoteException;
037    
038    
039        public Quote findOne ()
040            throws FinderException, RemoteException;
041    
042        public Collection findAll() 
043            throws FinderException, RemoteException;
044    
045            // Find TradeStockIndexAvg. Stocks -- unordered
046        public Collection findTSIAQuotes() 
047            throws FinderException, RemoteException;
048            // Find TradeStockIndexAvg. Stocks -- ordered by change
049        public Collection findTSIAQuotesOrderByChange() 
050            throws FinderException, RemoteException;
051            
052        /* findQuotes must take a comma seperated String of symbols
053         *  EJB QL will not take a collection type
054         */
055        public Collection findQuotes(String symbols)
056            throws FinderException, RemoteException;
057    
058    }