org.objectweb.jorm.mapper.rdb.genclass
Class RdbGenClassPNGIterator

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.genclass.RdbGenClassNameGetter
      extended byorg.objectweb.jorm.mapper.rdb.genclass.RdbGenClassPNGIterator
All Implemented Interfaces:
java.util.Iterator, PNameGetter, PNameIterator

public class RdbGenClassPNGIterator
extends org.objectweb.jorm.mapper.rdb.genclass.RdbGenClassNameGetter
implements PNameIterator

It is an iterator over a resultset. The next() method returns the PName.

Author:
S. Chassande-Barrioz

Field Summary
protected  RdbAdapter adapter
           
protected  FieldDesc[] elemFields
          The description of the fields of a composite name.
protected  java.sql.PreparedStatement ps
           
protected  java.sql.ResultSet resultSet
          The ResultSet pointing to the row from which to fetch the value of the fields of a composite name.
protected  int startIndex
           
 
Constructor Summary
RdbGenClassPNGIterator(java.sql.PreparedStatement ps, java.sql.ResultSet rs, FieldDesc[] rfds, RdbGenClassMapping gcm, boolean prefetching, RdbAdapter adapter)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 java.math.BigDecimal pngetBigDecimalField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a BigDecimal field.
 java.math.BigInteger pngetBigIntegerField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a BigInteger field.
 byte[] pngetByteArrayField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a string field.
 byte pngetByteField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a byte field.
 char[] pngetCharArrayField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a string field.
 char pngetCharField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a char field.
 java.util.Date pngetDateField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a date field.
 int pngetIntField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of an int field.
 long pngetLongField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a long field.
 java.lang.Byte pngetObyteField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a Byte field.
 java.lang.Character pngetOcharField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a Character field.
 java.lang.Integer pngetOintField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of an Integer field.
 java.lang.Long pngetOlongField(java.lang.String fn, java.lang.Object ctxt)
          It retrieves the value of a Long field.
 java.lang.Short pngetOshortField(java.lang.String fn, java.lang.Object context)
          It retrieves the value of a Short field.
 short pngetShortField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a short field.
 java.lang.String pngetStringField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a string field.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultSet

protected java.sql.ResultSet resultSet
The ResultSet pointing to the row from which to fetch the value of the fields of a composite name.


elemFields

protected FieldDesc[] elemFields
The description of the fields of a composite name.


ps

protected java.sql.PreparedStatement ps

adapter

protected RdbAdapter adapter

startIndex

protected int startIndex
Constructor Detail

RdbGenClassPNGIterator

public RdbGenClassPNGIterator(java.sql.PreparedStatement ps,
                              java.sql.ResultSet rs,
                              FieldDesc[] rfds,
                              RdbGenClassMapping gcm,
                              boolean prefetching,
                              RdbAdapter adapter)
                       throws java.sql.SQLException
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException

remove

public void remove()
            throws java.lang.UnsupportedOperationException
Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

close

public void close()
           throws PException
Specified by:
close in interface PNameIterator
Throws:
PException

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

pngetByteField

public byte pngetByteField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a byte field.

Specified by:
pngetByteField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The byte value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetObyteField

public java.lang.Byte pngetObyteField(java.lang.String fn,
                                      java.lang.Object context)
                               throws PExceptionTyping,
                                      PExceptionIO
It retrieves the value of a Byte field.

Specified by:
pngetObyteField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The Byte value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetCharField

public char pngetCharField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a char field.

Specified by:
pngetCharField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The char value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetOcharField

public java.lang.Character pngetOcharField(java.lang.String fn,
                                           java.lang.Object context)
                                    throws PExceptionTyping,
                                           PExceptionIO
It retrieves the value of a Character field.

Specified by:
pngetOcharField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The Character value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetShortField

public short pngetShortField(java.lang.String fn,
                             java.lang.Object ctx)
                      throws PExceptionTyping,
                             PExceptionIO
It retrieves the value of a short field.

Specified by:
pngetShortField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The short value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetOshortField

public java.lang.Short pngetOshortField(java.lang.String fn,
                                        java.lang.Object context)
                                 throws PExceptionTyping,
                                        PExceptionIO
It retrieves the value of a Short field.

Specified by:
pngetOshortField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The Short value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetIntField

public int pngetIntField(java.lang.String fn,
                         java.lang.Object ctx)
                  throws PExceptionTyping,
                         PExceptionIO
It retrieves the value of an int field.

Specified by:
pngetIntField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The int value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetOintField

public java.lang.Integer pngetOintField(java.lang.String fn,
                                        java.lang.Object ctxt)
                                 throws PExceptionTyping,
                                        PExceptionIO
It retrieves the value of an Integer field.

Specified by:
pngetOintField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Integer value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetLongField

public long pngetLongField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a long field.

Specified by:
pngetLongField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The long value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetOlongField

public java.lang.Long pngetOlongField(java.lang.String fn,
                                      java.lang.Object ctxt)
                               throws PExceptionTyping,
                                      PExceptionIO
It retrieves the value of a Long field.

Specified by:
pngetOlongField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The Long value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetStringField

public java.lang.String pngetStringField(java.lang.String fn,
                                         java.lang.Object ctx)
                                  throws PExceptionTyping,
                                         PExceptionIO
It retrieves the value of a string field.

Specified by:
pngetStringField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetByteArrayField

public byte[] pngetByteArrayField(java.lang.String fn,
                                  java.lang.Object ctx)
                           throws PExceptionTyping,
                                  PExceptionIO
It retrieves the value of a string field.

Specified by:
pngetByteArrayField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetCharArrayField

public char[] pngetCharArrayField(java.lang.String fn,
                                  java.lang.Object ctx)
                           throws PExceptionTyping,
                                  PExceptionIO
It retrieves the value of a string field.

Specified by:
pngetCharArrayField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctx - A context used by PNameGetter to extract the related data.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetDateField

public java.util.Date pngetDateField(java.lang.String fn,
                                     java.lang.Object ctxt)
                              throws PExceptionTyping,
                                     PExceptionIO
It retrieves the value of a date field.

Specified by:
pngetDateField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The java.util.Date value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetBigIntegerField

public java.math.BigInteger pngetBigIntegerField(java.lang.String fn,
                                                 java.lang.Object ctxt)
                                          throws PException
It retrieves the value of a BigInteger field.

Specified by:
pngetBigIntegerField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The java.math.BigInteger value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException

pngetBigDecimalField

public java.math.BigDecimal pngetBigDecimalField(java.lang.String fn,
                                                 java.lang.Object ctxt)
                                          throws PException
It retrieves the value of a BigDecimal field.

Specified by:
pngetBigDecimalField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
ctxt - A context used by PNameGetter to extract the related data.
Returns:
The java.math.BigDecimal value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.
PException