Examples of IBookHome


Examples of org.apache.tapestry.vlib.ejb.IBookHome

    
     **/

    public void updateBook(Integer bookId, Map attributes) throws FinderException, RemoteException
    {
        IBookHome bookHome = getBookHome();

        IBook book = bookHome.findByPrimaryKey(bookId);

        book.updateEntityAttributes(attributes);
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

        return result;
    }

    public Map getBookAttributes(Integer bookId) throws FinderException, RemoteException
    {
        IBookHome home = getBookHome();

        IBook book = home.findByPrimaryKey(bookId);

        return book.getEntityAttributes();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

        }
    }

    public Book deleteBook(Integer bookId) throws RemoveException, RemoteException
    {
        IBookHome home = getBookHome();
        Book result = null;

        try
        {
            result = getBook(bookId);
        }
        catch (FinderException ex)
        {
            throw new XRemoveException(ex);
        }

        home.remove(bookId);

        return result;

    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

        IPersonHome personHome = getPersonHome();
        personHome.findByPrimaryKey(newOwnerId);

        // Direct SQL would be more efficient, but this'll probably do.

        IBookHome home = getBookHome();

        for (int i = 0; i < bookIds.length; i++)
        {
            IBook book = home.findByPrimaryKey(bookIds[i]);

            book.setOwnerId(newOwnerId);
        }
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

        }
    }

    public Book returnBook(Integer bookId) throws RemoteException, FinderException
    {
        IBookHome bookHome = getBookHome();
        IBook book = bookHome.findByPrimaryKey(bookId);

        Integer ownerPK = book.getOwnerId();

        book.setHolderId(ownerPK);
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

     **/

    public Book borrowBook(Integer bookId, Integer borrowerId)
        throws FinderException, RemoteException, BorrowException
    {
        IBookHome bookHome = getBookHome();
        IPersonHome personHome = getPersonHome();

        IBook book = bookHome.findByPrimaryKey(bookId);

        if (!book.getLendable())
            throw new BorrowException("Book may not be borrowed.");

        // Verify that the borrower exists.
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

     *
     **/

    public Integer addBook(Map attributes) throws CreateException, RemoteException
    {
        IBookHome home = getBookHome();

        attributes.put("dateAdded", new Timestamp(System.currentTimeMillis()));

        IBook book = home.create(attributes);

        return (Integer) book.getPrimaryKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

     **/

    public Book borrowBook(Integer bookId, Integer borrowerId)
        throws FinderException, RemoteException, BorrowException
    {
        IBookHome bookHome = getBookHome();
        IPersonHome personHome = getPersonHome();

        IBook book = bookHome.findByPrimaryKey(bookId);

        if (!book.getLendable())
            throw new BorrowException("Book may not be borrowed.");

        // Verify that the borrower exists.
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

     *
     **/

    public Integer addBook(Map attributes) throws CreateException, RemoteException
    {
        IBookHome home = getBookHome();

        attributes.put("dateAdded", new Timestamp(System.currentTimeMillis()));

        IBook book = home.create(attributes);

        return (Integer) book.getPrimaryKey();
    }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.IBookHome

    
     **/

    public void updateBook(Integer bookId, Map attributes) throws FinderException, RemoteException
    {
        IBookHome bookHome = getBookHome();

        IBook book = bookHome.findByPrimaryKey(bookId);

        book.updateEntityAttributes(attributes);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.