Package org.apache.openjpa.trader.domain

Examples of org.apache.openjpa.trader.domain.Trade


        return t;
    }

    @Override
    public Trade trade(Match match) {
        Trade trade = new Trade(match.getAsk(), match.getBid());
        return trade;
    }
View Full Code Here


     * Because an instance display either the Trades sold or bought.
     * If relevant then updates the display.
     */
    public void onTradeCommitted(ServiceEvent.TradeCommitted event) {
        Trader trader = session.getTrader();
        Trade trade = event.getPayload();
        if ((trader.equals(trade.getSeller()) && _type == Ask.class)
         || (trader.equals(trade.getBuyer())  && _type == Bid.class)) {  
            insert(trade);
        }
    }
View Full Code Here

    public Trade trade(Match match) {
        EntityManager em = getEntityManager();
        begin();
        Ask ask = em.merge(match.getAsk());
        Bid bid = em.merge(match.getBid());
        Trade trade = new Trade(ask, bid);
        em.persist(trade);
        commit();
        return trade;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.trader.domain.Trade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.