com.primix.vlib.ejb.impl
Class BookQueryBean

java.lang.Object
  |
  +--com.primix.vlib.ejb.impl.OperationsBean
        |
        +--com.primix.vlib.ejb.impl.BookQueryBean
All Implemented Interfaces:
EnterpriseBean, IMailMessageConstants, java.io.Serializable, SessionBean

public class BookQueryBean
extends OperationsBean

Implementation of a stateful session bean used to query the IBook entity and cache the results. It can then download the results, in chunks, to the client ... this is used to support clients that which to display the results a page at a time (with random access to the pages of results).

To avoid a lot of duplicate code for things like finding the JDBC Connection and querying the IBook entity, we subclass from OperationsBean.

Version:
$Id: BookQueryBean.java,v 1.2 2001/06/19 20:32:00 hship Exp $
Author:
Howard Ship
See Also:
IBookQuery, IBookQueryHome, Serialized Form

Fields inherited from class com.primix.vlib.ejb.impl.OperationsBean
MAIL_QUEUE_JNDI_NAME
 
Fields inherited from interface com.primix.vlib.ejb.IMailMessageConstants
CONTENT, EMAIL_ADDRESS, SUBJECT
 
Constructor Summary
BookQueryBean()
           
 
Method Summary
 int borrowerQuery(java.lang.Integer borrowerPK)
           
 void ejbRemove()
          Releases any results.
 Book[] get(int offset, int length)
          Gets a subset of the results from the query.
 int getResultCount()
          Returns the number of results from the most recent query.
 int holderQuery(java.lang.Integer holderPK)
          Queries on books held (borrowed) by a given person, sorted by title.
 int masterQuery(java.lang.String title, java.lang.String author, java.lang.Object publisherPK)
          The master query is for querying by some mixture of title, author and publisher.
 int ownerQuery(java.lang.Integer ownerPK)
          Queries on books owned by a given person, sorted by title.
 
Methods inherited from class com.primix.vlib.ejb.impl.OperationsBean
addBook, addBook, addSubstringSearch, borrowBook, buildBaseBookQuery, buildBasePersonQuery, close, convertRowToBook, convertRowToPerson, deleteBook, ejbActivate, ejbCreate, ejbPassivate, getBook, getBookAttributes, getConnection, getMailQueueSender, getMailQueueSession, getPerson, getPersonAttributes, getPersons, getPublishers, login, registerNewUser, returnBook, sendMail, setSessionContext, transferBooks, updateBook, updateBook, updatePerson, updatePersons, updatePublishers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BookQueryBean

public BookQueryBean()
Method Detail

ejbRemove

public void ejbRemove()
Releases any results.
Overrides:
ejbRemove in class OperationsBean

getResultCount

public int getResultCount()
Returns the number of results from the most recent query.

get

public Book[] get(int offset,
                  int length)
Gets a subset of the results from the query.

masterQuery

public int masterQuery(java.lang.String title,
                       java.lang.String author,
                       java.lang.Object publisherPK)
The master query is for querying by some mixture of title, author and publisher.

ownerQuery

public int ownerQuery(java.lang.Integer ownerPK)
Queries on books owned by a given person, sorted by title.

holderQuery

public int holderQuery(java.lang.Integer holderPK)
Queries on books held (borrowed) by a given person, sorted by title.

borrowerQuery

public int borrowerQuery(java.lang.Integer borrowerPK)