de.mguennewig.pobjects
Class Record

java.lang.Object
  extended by de.mguennewig.pobjects.Record
Direct Known Subclasses:
DynamicRecord, FileRecord, PObject

public abstract class Record
extends java.lang.Object

All data extracted from the RDBMS is stored in instances of this type. The code generator produces extensions of the class for every table, select or view in the dictionary definition. The derived class PObject is used for updatable table rows, while queries on selects and views return read-only Records.

Author:
Michael Günnewig

Constructor Summary
Record()
          Creates a new Record.
 
Method Summary
 java.lang.String format(Column column)
           
 java.lang.Object get(Column c)
          Returns the value of column c.
abstract  java.lang.Object get(int index)
          Get value of field with index index.
abstract  TableExpr getTableExpr()
          Returns the metadata declaration for this Record.
 void set(Column c, java.lang.Object value)
          Set value of column c.
abstract  void set(int index, java.lang.Object value)
          Set value of field with index index.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Record

public Record()
Creates a new Record.

Method Detail

getTableExpr

public abstract TableExpr getTableExpr()
Returns the metadata declaration for this Record.


get

public abstract java.lang.Object get(int index)
Get value of field with index index.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field getXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Throws:
java.lang.IndexOutOfBoundsException - if no field with the given index exists.

set

public abstract void set(int index,
                         java.lang.Object value)
Set value of field with index index.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field setXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Throws:
java.lang.ClassCastException - if value is of wrong type for the specified column.
java.lang.IndexOutOfBoundsException - if no field with the given index exists.

get

public final java.lang.Object get(Column c)
Returns the value of column c.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field getXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Throws:
java.lang.IndexOutOfBoundsException - if no column c exists.
See Also:
Column.getIndex(), get(int)

set

public void set(Column c,
                java.lang.Object value)
Set value of column c.

This method is primarily intended for use by procedures that work on meta level of de.mguennewig.pobjects. It differs from the per field setXXX() methods in that it does not load the object's data if it is not in memory. If unsure whether the object's state has been internalized, then any call to this method must be preceded by a call to PObject.loadIfReference().

Throws:
java.lang.ClassCastException - if value is of wrong type for the specified column.
java.lang.IndexOutOfBoundsException - if no column c exists.
See Also:
Column.getIndex(), set(int,Object)

format

public final java.lang.String format(Column column)