Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

com.healthmarketscience.jackcess
Class Joiner

java.lang.Object
  extended by com.healthmarketscience.jackcess.Joiner

public class Joiner
extends java.lang.Object

Utility for finding rows based on pre-defined, foreign-key table relationships.


Method Summary
static Joiner create(Index fromIndex)
          Creates a new Joiner based on the given index which backs a foreign-key relationship.
static Joiner create(Table fromTable, Table toTable)
          Creates a new Joiner based on the foreign-key relationship between the given "from"" table and the given "to"" table.
 Joiner createReverse()
          Creates a new Joiner that is the reverse of this Joiner (the "from" and "to" tables are swapped).
 java.util.Map<java.lang.String,java.lang.Object> findFirstRow(java.util.Map<java.lang.String,?> fromRow)
          Returns the first row in the "to" table based on the given columns in the "from" table if any, null if there is no matching row.
 java.util.Map<java.lang.String,java.lang.Object> findFirstRow(java.util.Map<java.lang.String,?> fromRow, java.util.Collection<java.lang.String> columnNames)
          Returns selected columns from the first row in the "to" table based on the given columns in the "from" table if any, null if there is no matching row.
 java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> findRows(java.util.Map<java.lang.String,?> fromRow)
          Returns an Iterator over all the rows in the "to" table based on the given columns in the "from" table.
 java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> findRows(java.util.Map<java.lang.String,?> fromRow, java.util.Collection<java.lang.String> columnNames)
          Returns an Iterator with the selected columns over all the rows in the "to" table based on the given columns in the "from" table.
 java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>> findRowsIterable(java.util.Map<java.lang.String,?> fromRow)
          Returns an Iterable whose iterator() method returns the result of a call to findRows(Map)
 java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>> findRowsIterable(java.util.Map<java.lang.String,?> fromRow, java.util.Collection<java.lang.String> columnNames)
          Returns an Iterable whose iterator() method returns the result of a call to findRows(Map,Collection)
 Index getFromIndex()
           
 Table getFromTable()
           
 IndexCursor getToCursor()
           
 Index getToIndex()
           
 Table getToTable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Joiner create(Table fromTable,
                            Table toTable)
                     throws java.io.IOException
Creates a new Joiner based on the foreign-key relationship between the given "from"" table and the given "to"" table.

Parameters:
fromTable - the "from" side of the relationship
toTable - the "to" side of the relationship
Throws:
java.lang.IllegalArgumentException - if there is no relationship between the given tables
java.io.IOException

create

public static Joiner create(Index fromIndex)
                     throws java.io.IOException
Creates a new Joiner based on the given index which backs a foreign-key relationship. The table of the given index will be the "from" table and the table on the other end of the relationship will be the "to" table.

Parameters:
fromIndex - the index backing one side of a foreign-key relationship
Throws:
java.io.IOException

createReverse

public Joiner createReverse()
                     throws java.io.IOException
Creates a new Joiner that is the reverse of this Joiner (the "from" and "to" tables are swapped).

Throws:
java.io.IOException

getFromTable

public Table getFromTable()

getFromIndex

public Index getFromIndex()

getToTable

public Table getToTable()

getToIndex

public Index getToIndex()

getToCursor

public IndexCursor getToCursor()

findFirstRow

public java.util.Map<java.lang.String,java.lang.Object> findFirstRow(java.util.Map<java.lang.String,?> fromRow)
                                                              throws java.io.IOException
Returns the first row in the "to" table based on the given columns in the "from" table if any, null if there is no matching row.

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)
Throws:
java.io.IOException

findFirstRow

public java.util.Map<java.lang.String,java.lang.Object> findFirstRow(java.util.Map<java.lang.String,?> fromRow,
                                                                     java.util.Collection<java.lang.String> columnNames)
                                                              throws java.io.IOException
Returns selected columns from the first row in the "to" table based on the given columns in the "from" table if any, null if there is no matching row.

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)
columnNames - desired columns in the from table row
Throws:
java.io.IOException

findRows

public java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> findRows(java.util.Map<java.lang.String,?> fromRow)
Returns an Iterator over all the rows in the "to" table based on the given columns in the "from" table.

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)

findRows

public java.util.Iterator<java.util.Map<java.lang.String,java.lang.Object>> findRows(java.util.Map<java.lang.String,?> fromRow,
                                                                                     java.util.Collection<java.lang.String> columnNames)
Returns an Iterator with the selected columns over all the rows in the "to" table based on the given columns in the "from" table.

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)
columnNames - desired columns in the from table row

findRowsIterable

public java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>> findRowsIterable(java.util.Map<java.lang.String,?> fromRow)
Returns an Iterable whose iterator() method returns the result of a call to findRows(Map)

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)
Throws:
java.lang.IllegalStateException - if an IOException is thrown by one of the operations, the actual exception will be contained within

findRowsIterable

public java.lang.Iterable<java.util.Map<java.lang.String,java.lang.Object>> findRowsIterable(java.util.Map<java.lang.String,?> fromRow,
                                                                                             java.util.Collection<java.lang.String> columnNames)
Returns an Iterable whose iterator() method returns the result of a call to findRows(Map,Collection)

Parameters:
fromRow - row from the "from" table (which must include the relevant columns for this join relationship)
columnNames - desired columns in the from table row
Throws:
java.lang.IllegalStateException - if an IOException is thrown by one of the operations, the actual exception will be contained within

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013