/* * ==================================================================== * * TORPEDO * A Testbed of Object Relational Products for Enterprise Distributed Objects * Copyright (c) 2004 The Middleware Company All Rights Reserved * @author Bruce Martin * @version 8.25.04 * * ==================================================================== */ package com.middleware_company.torpedo.auction; import javax.naming.NamingException; import java.util.Collection; public abstract class Persistence { public abstract Bid createBid(String ID, Auction auction, User buyer, Float amount, Float maxAmount) throws AuctionServiceException,NamingException; public abstract Auction getAuction(String auctionID) throws AuctionServiceException,NamingException; public Auction getDetailAuction(String auctionID) throws AuctionServiceException,NamingException { // default behavior is just to get the auction. O-R mapping specific classes // may want to override the method to do an optimization return getAuction(auctionID); } public abstract User getUser(String ID) throws AuctionServiceException,NamingException; public abstract Collection findAllAuctions() throws AuctionServiceException,NamingException; public abstract Collection findHighBids(String auctionID) throws AuctionServiceException,NamingException; public Auction getPartialAuction(String auctionID) throws AuctionServiceException,NamingException { // default behavior is just to get the auction. O-R mapping specific classes // may want to override the method to do an optimization return getAuction(auctionID); } public AuctionInfo createAuctionInfo(Auction auction, boolean partial) { return new AuctionInfo(auction,partial); } public BidInfo createBidInfo(Bid bid) { return new BidInfo(bid); } // The next operation is for Object-Relational mapping software that needs to be explicitly cleaned up. // Those that do not, (e.g. CMP, JDO and Toplink) simply ignore this operation. public void close() {} }