javax.rad.model.reference
Class ReferenceDefinition

java.lang.Object
  extended by javax.rad.model.reference.ColumnMapping
      extended by javax.rad.model.reference.ReferenceDefinition
All Implemented Interfaces:
Serializable, Cloneable

public class ReferenceDefinition
extends ColumnMapping

The ReferenceDefinition specifies the relation between a detail DataBook and the master DataBook.
It also can be used as binding between a drop down list (with an list of items to choose from) and the corresponding "master" DataBook to write the defined item (e.g. PrimaryKey columns to ForeignKey columns) back to it.

Example:

 
 ReferenceDefinition bdDETAILtoTEST = new ReferenceDefinition();
 bdDETAILtoTEST.setReferencedDataBook(dbDataBook);
 bdDETAILtoTEST.setReferencedColumns(new String [] { "ID" });
 bdDETAILtoTEST.setColumns(new String [] { "TEST_ID" });
 
 DataBook dbDataBook = new DataBook();
 dbDataBook.setDataSource(dba);
 dbDataBook.setName("TEST");
 
 DataBook dbDetail = new DataBook();
 dbDetail.setDataSource(dba);
 dbDetail.setName("DETAIL");
 dbDetail.setMasterReference(bdDETAILtoTEST);
 dbDetail.open();
 
 dbDataBook.open();
 
 

See Also:
RemoteDataBook, Serialized Form

Constructor Summary
ReferenceDefinition()
          Constructs the ReferenceDefinition without parameters.
ReferenceDefinition(String[] pColumnNames, IDataBook pReferencedDataBook, String[] pReferencedColumnNames)
          Constructs the ReferenceDefinition with the specified parameters.
 
Method Summary
 IDataBook getReferencedDataBook()
          Returns the referenced (master) IDataBook of the ReferenceDefinition.
 void setColumnNames(String[] pColumnNames)
          Sets the source (detail) ColumnDefinition's to use in this ReferenceDefinition.
 void setConnected()
          Sets the ReferenceDefinition connected to the source IDataBook.
 void setReferencedColumnNames(String[] pReferencedColumnNames)
          Sets the referenced (master) column names to use in this ReferenceDefinition.
 void setReferencedDataBook(IDataBook pReferencedDataBook)
          Sets the referenced IDataBook of the ReferenceDefinition.
 String toString()
          
 
Methods inherited from class javax.rad.model.reference.ColumnMapping
clone, equals, getColumnNames, getReferencedColumnName, getReferencedColumnNames, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceDefinition

public ReferenceDefinition()
Constructs the ReferenceDefinition without parameters.


ReferenceDefinition

public ReferenceDefinition(String[] pColumnNames,
                           IDataBook pReferencedDataBook,
                           String[] pReferencedColumnNames)
                    throws ModelException
Constructs the ReferenceDefinition with the specified parameters.

Parameters:
pColumnNames - the source column names to use in this ReferenceDefinition
pReferencedDataBook - the referenced IDataBook of the ReferenceDefinition
pReferencedColumnNames - the referenced column names to use in this ReferenceDefinition
Throws:
ModelException - if one the parameters is null or empty
Method Detail

toString

public String toString()

Overrides:
toString in class ColumnMapping

setReferencedDataBook

public void setReferencedDataBook(IDataBook pReferencedDataBook)
Sets the referenced IDataBook of the ReferenceDefinition.

Parameters:
pReferencedDataBook - the referenced (master) IDataBook

getReferencedDataBook

public IDataBook getReferencedDataBook()
Returns the referenced (master) IDataBook of the ReferenceDefinition.

Returns:
the referenced (master) IDataBook of the ReferenceDefinition.

setReferencedColumnNames

public void setReferencedColumnNames(String[] pReferencedColumnNames)
Sets the referenced (master) column names to use in this ReferenceDefinition.

Overrides:
setReferencedColumnNames in class ColumnMapping
Parameters:
pReferencedColumnNames - the referenced (master) column names to use

setColumnNames

public void setColumnNames(String[] pColumnNames)
Sets the source (detail) ColumnDefinition's to use in this ReferenceDefinition.

Overrides:
setColumnNames in class ColumnMapping
Parameters:
pColumnNames - the source (detail) column names

setConnected

public void setConnected()
Sets the ReferenceDefinition connected to the source IDataBook. Internal use only!



Copyright © 2009 SIB Visions GmbH. All Rights Reserved.