Examples of IBook


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

        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.

        personHome.findByPrimaryKey(borrowerId);

        // TBD: Check that borrower has authenticated

        // findByPrimaryKey() throws an exception if the EJB doesn't exist,
        // so we're safe.

        personHome.findByPrimaryKey(book.getOwnerId());

        // Here's the real work; just setting the holder of the book
        // to be the borrower.

        book.setHolderId(borrowerId);

        return getBook(bookId);
    }
View Full Code Here

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

    {
        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.IBook

    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.IBook

    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.IBook

        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.IBook

    }

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

        Integer ownerPK = book.getOwnerId();

        book.setHolderId(ownerPK);

        return getBook(bookId);
    }
View Full Code Here

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

        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.

        personHome.findByPrimaryKey(borrowerId);

        // TBD: Check that borrower has authenticated

        // findByPrimaryKey() throws an exception if the EJB doesn't exist,
        // so we're safe.

        personHome.findByPrimaryKey(book.getOwnerId());

        // Here's the real work; just setting the holder of the book
        // to be the borrower.

        book.setHolderId(borrowerId);

        return getBook(bookId);
    }
View Full Code Here

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

    {
        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.IBook

    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.IBook

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

        IBook book = home.findByPrimaryKey(bookId);

        return book.getEntityAttributes();
    }
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.