org.apache.ojb.broker.accesslayer
Class PkEnumeration

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.PkEnumeration
All Implemented Interfaces:
Enumeration

public class PkEnumeration
extends Object
implements Enumeration

this class can be used to create enumerations of PrimaryKey objects. This is interesting for EJB finder methods in BMP entity beans which must return such enumerations.

Version:
$Id: PkEnumeration.java,v 1.1 2007-08-24 22:17:30 ewestfal Exp $
Author:
Thomas Mahler

Field Summary
protected  PersistenceBroker broker
           
protected  ClassDescriptor classDescriptor
          descriptor for the class of which items are to be found
protected  Constructor constructor
          the Constructor that is needed to build the PrimaryKey Objects
protected  boolean hasCalledCheck
           
protected  boolean hasNext
           
protected  ResultSetAndStatement resultSetAndStatment
          The underlying jdbc resultset produced by select statement
 
Constructor Summary
PkEnumeration(Query query, ClassDescriptor cld, Class primaryKeyClass, PersistenceBroker broker)
          PkEnumeration constructor.
 
Method Summary
protected  void finalize()
          protection just in case someone leaks.
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hasCalledCheck

protected boolean hasCalledCheck

hasNext

protected boolean hasNext

broker

protected PersistenceBroker broker

resultSetAndStatment

protected ResultSetAndStatement resultSetAndStatment
The underlying jdbc resultset produced by select statement


classDescriptor

protected ClassDescriptor classDescriptor
descriptor for the class of which items are to be found


constructor

protected Constructor constructor
the Constructor that is needed to build the PrimaryKey Objects

Constructor Detail

PkEnumeration

public PkEnumeration(Query query,
                     ClassDescriptor cld,
                     Class primaryKeyClass,
                     PersistenceBroker broker)
PkEnumeration constructor.

Parameters:
query - the SELECT statement gerating the underlying resultset
cld - classDescriptor of the target entity class (say Article)
primaryKeyClass - the entity classes PrimaryKey class (say ArticleKey). this key-class MUST have a constructor with one argument of type org.apache.ojb.broker.Identity !
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface Enumeration
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.

finalize

protected void finalize()
protection just in case someone leaks.

Overrides:
finalize in class Object


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.