org.apache.ojb.broker.accesslayer
Class PkEnumeration

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

public class PkEnumeration
extends java.lang.Object
implements java.util.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 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler

Constructor Summary
PkEnumeration(Query query, ClassDescriptor cld, java.lang.Class primaryKeyClass, PersistenceBroker broker)
          PkEnumeration constructor.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 java.lang.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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PkEnumeration

public PkEnumeration(Query query,
                     ClassDescriptor cld,
                     java.lang.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 java.util.Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public java.lang.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 java.util.Enumeration
Returns:
the next element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30