2.17.2: 2011-06-17

net.sf.basedb.core.query
Interface AutoJoiner<Q extends Query,E extends QueryElement>

All Known Implementing Classes:
DynamicPositionQueryJoiners.ExtraValueJoiner, DynamicPositionQueryJoiners.ReporterJoiner, DynamicSpotQueryJoiners.ExtraValueJoiner, DynamicSpotQueryJoiners.RawDataJoiner, DynamicSpotQueryJoiners.ReporterJoiner, DynamicSpotQueryJoiners.ReporterListJoiner, HqlQueryJoiners.ReporterListJoiner

public interface AutoJoiner<Q extends Query,E extends QueryElement>

An AutoJoiner is an object that automatically joins other tables in query depending on other query elements. For example, if we use the Dynamic.select(net.sf.basedb.core.ExtraValue, String) to select an extra value, the DynamicSpotQueryJoiners makes sure that the table containing the extra values is joined to the query by calling the DynamicSpotQuery.joinExtraValue(net.sf.basedb.core.ExtraValue, JoinType) method.

How to programmatically join the correct table differs from query type to query type and from query element to query element. Each combination of query and query element usually needs it's own implementation of this interface.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2008-09-11 22:09:17 +0200 (Thu, 11 Sep 2008) $

Method Summary
 Class<E> getElementClass()
          The type of the query element the implementation works for.
 Class<Q> getQueryClass()
          The type of the query the implementation works for.
 void joinIfNeeded(Q query, E element)
          Automatically join the tables that is is needed by the query element unless they are already joined.
 

Method Detail

getQueryClass

Class<Q> getQueryClass()
The type of the query the implementation works for. This can be an actual subclass or a superclass.

Returns:
A class object representing the query type

getElementClass

Class<E> getElementClass()
The type of the query element the implementation works for. This can be an actual subclass or a superclass.

Returns:
A class object representing the query element type

joinIfNeeded

void joinIfNeeded(Q query,
                  E element)
Automatically join the tables that is is needed by the query element unless they are already joined.

Parameters:
query - The query
element - The query element

2.17.2: 2011-06-17