|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.gps.device.AbstractGpsDevice
org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
org.compass.gps.device.ibatis.SqlMapClientGpsDevice
public class SqlMapClientGpsDevice
A SqlMapClient device, provides support for iBatis 2 and the
index operation. The device holds a list of iBatis select
statements ids, executes them, and index the result.
The device must be initialized with a SqlMapClient instance.
When indexing the data, a SqlMapSession will be opened, and a
transaction will be started. The device will then execute the select
statement id, and use the iBatis PaginatedList to index the
data.
The page size for the PaginatedList can be controlled using
the pageSize property.
The select statment can have a parameter object associated with it. If one of
the select statements requires a parameter object, then the
statementsParameterObjects property must be set. It must have
the same size as the selectStatementsIds, and the matching
index of the selectStatementsIds should be set at the
statementsParameterObjects property.
As a replacement, the setIndexStatements(IndexStatement[]) can be used
which combines both a select statement id and its optional parameter.
| Nested Class Summary | |
|---|---|
class |
SqlMapClientGpsDevice.SqlMapClientGpsDeviceRowHandler
|
| Field Summary |
|---|
| Fields inherited from class org.compass.gps.device.AbstractGpsDevice |
|---|
compassGps, log |
| Constructor Summary | |
|---|---|
SqlMapClientGpsDevice()
|
|
SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
IndexStatement... statements)
|
|
SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
String... selectStatementsIds)
|
|
SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
String[] selectStatementsIds,
Object[] statementsParameterObjects)
|
|
| Method Summary | |
|---|---|
protected IndexEntity[] |
doGetIndexEntities()
Returns all the indexed entities for this device. |
protected IndexEntitiesIndexer |
doGetIndexEntitiesIndexer()
Returns an index entities indexer that knows how to index indexable entities. |
protected void |
doStart()
Derived devices can implement it in case of start event notification. |
com.ibatis.sqlmap.client.SqlMapClient |
getSqlMapClient()
|
void |
setIndexStatements(IndexStatement... statements)
Sets the given index statements that will be used. |
void |
setPageSize(int pageSize)
Sets the pagination/fetch size when iterating through the result set. |
void |
setSelectStatementsIds(String... statementsNames)
Sets the select statement ids that will be used to fetch data to be indexed. |
void |
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
|
void |
setStatementsParameterObjects(Object[] statementsParameterObjects)
Sets the select statement parameters for each select statment. |
| Methods inherited from class org.compass.gps.device.support.parallel.AbstractParallelGpsDevice |
|---|
doIndex, index, setIndexEntitiesPartitioner, setParallelIndexExecutor, start |
| Methods inherited from class org.compass.gps.device.AbstractGpsDevice |
|---|
buildMessage, doStop, getGps, getName, injectGps, isFilteredForIndex, isPerformingIndexOperation, isRunning, refresh, setFilteredEntitiesForIndex, setName, shouldMirrorDataChanges, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SqlMapClientGpsDevice()
public SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
IndexStatement... statements)
public SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
String... selectStatementsIds)
public SqlMapClientGpsDevice(String deviceName,
com.ibatis.sqlmap.client.SqlMapClient sqlMapClient,
String[] selectStatementsIds,
Object[] statementsParameterObjects)
| Method Detail |
|---|
protected void doStart()
throws CompassGpsException
AbstractGpsDevice
doStart in class AbstractGpsDeviceCompassGpsException
protected IndexEntity[] doGetIndexEntities()
throws CompassGpsException
AbstractParallelGpsDevice
doGetIndexEntities in class AbstractParallelGpsDeviceCompassGpsExceptionprotected IndexEntitiesIndexer doGetIndexEntitiesIndexer()
AbstractParallelGpsDevice
doGetIndexEntitiesIndexer in class AbstractParallelGpsDevicepublic com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
public void setIndexStatements(IndexStatement... statements)
Note, this method is used to replace the combination of setSelectStatementsIds(String[]) and
setStatementsParameterObjects(Object[]).
public void setSelectStatementsIds(String... statementsNames)
setStatementsParameterObjects(Object[]) with
the order similar to the statement ids.
Note, this method can be replaced with setIndexStatements(IndexStatement[]).
public void setStatementsParameterObjects(Object[] statementsParameterObjects)
setSelectStatementsIds(String[]) order.
Note, the setIndexStatements(IndexStatement[]) can replce the combination of
setSelectStatementsIds(String[]) and setStatementsParameterObjects(Object[]).
public void setPageSize(int pageSize)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||