|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.healthmarketscience.jackcess.util.Joiner
public class Joiner
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). |
boolean |
deleteRows(Map<String,?> fromRow)
Deletes any rows in the "to" table based on the given columns in the "from" table. |
boolean |
deleteRows(Object[] fromRow)
Deletes any rows in the "to" table based on the given columns in the "from" table. |
Row |
findFirstRow(Map<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. |
Row |
findFirstRow(Map<String,?> fromRow,
Collection<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. |
EntryIterableBuilder |
findRows(Map<String,?> fromRow)
Returns an Iterator over all the rows in the "to" table based on the given columns in the "from" table. |
EntryIterableBuilder |
findRows(Object[] fromRow)
Returns an Iterator with the selected columns over all the rows in the "to" table based on the given columns in the "from" table. |
List<? extends Index.Column> |
getColumns()
|
Index |
getFromIndex()
|
Table |
getFromTable()
|
IndexCursor |
getToCursor()
|
Index |
getToIndex()
|
Table |
getToTable()
|
boolean |
hasRows(Map<String,?> fromRow)
Returns true if the "to" table has any rows based on the given
columns in the "from" table, false otherwise. |
boolean |
hasRows(Object[] fromRow)
Returns true if the "to" table has any rows based on the given
columns in the "from" table, false otherwise. |
String |
toFKString()
Returns a pretty string describing the foreign key relationship backing this Joiner. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Joiner create(Table fromTable,
Table toTable)
throws IOException
fromTable - the "from" side of the relationshiptoTable - the "to" side of the relationship
IllegalArgumentException - if there is no relationship between the
given tables
IOException
public static Joiner create(Index fromIndex)
throws IOException
fromIndex - the index backing one side of a foreign-key relationship
IOException
public Joiner createReverse()
throws IOException
IOExceptionpublic Table getFromTable()
public Index getFromIndex()
public Table getToTable()
public Index getToIndex()
public IndexCursor getToCursor()
public List<? extends Index.Column> getColumns()
public boolean hasRows(Map<String,?> fromRow)
throws IOException
true if the "to" table has any rows based on the given
columns in the "from" table, false otherwise.
IOException
public boolean hasRows(Object[] fromRow)
throws IOException
true if the "to" table has any rows based on the given
columns in the "from" table, false otherwise.
IOException
public Row findFirstRow(Map<String,?> fromRow)
throws IOException
null if there is no matching row.
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)
IOException
public Row findFirstRow(Map<String,?> fromRow,
Collection<String> columnNames)
throws IOException
null if there is no
matching row.
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)columnNames - desired columns in the from table row
IOExceptionpublic EntryIterableBuilder findRows(Map<String,?> fromRow)
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)public EntryIterableBuilder findRows(Object[] fromRow)
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)
public boolean deleteRows(Map<String,?> fromRow)
throws IOException
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)
true if any "to" rows were deleted, false
otherwise
IOException
public boolean deleteRows(Object[] fromRow)
throws IOException
fromRow - row from the "from" table (which must include the relevant
columns for this join relationship)
true if any "to" rows were deleted, false
otherwise
IOExceptionpublic String toFKString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||