Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoinx.clef.irs.mysql
Class CLEFMySQLAdapter  view CLEFMySQLAdapter download CLEFMySQLAdapter.java

java.lang.Object
  extended byrecoin.group.ComponentWorker
      extended byrecoin.group.adapter.JDBCAdapter
          extended byrecoin.group.adapter.JDBCSingleAdapter
              extended byrecoinx.clef.irs.mysql.CLEFMySQLAdapter
Direct Known Subclasses:
MySQLEnglishAdapter, MySQLFrenchAdapter, MySQLGermanAdapter, MySQLSpanishAdapter

public abstract class CLEFMySQLAdapter
extends recoin.group.adapter.JDBCSingleAdapter

Abstract super class for ComponentWorkers that use the MySQL search engine for retrieval.

This class provides attributes and methods to search the indexes of the MySQL database.

Version:
0.2.9

Nested Class Summary
protected  class CLEFMySQLAdapter.MySQLRunnable
          The MySQLRunnable class implements the special behavior to query the indexes of the database.
 
Field Summary
(package private) static org.apache.log4j.Logger logger
          The logger of this class.
protected  boolean merge
          Flag to signal whether any results from the different collections should be merged into one CLEFResultList or added to the container separately.
protected  boolean normalize
          Flag to signal whether any results should be normalized.
private  java.sql.PreparedStatement statement
          A PreparedStatement.
protected  int[] tables
          The static int values of the collections to search.
 
Fields inherited from class recoin.group.adapter.JDBCSingleAdapter
connection
 
Fields inherited from class recoin.group.adapter.JDBCAdapter
databaseName, driverName, jdbcURL, password, port, serverName, user
 
Fields inherited from class recoin.group.ComponentWorker
component
 
Constructor Summary
CLEFMySQLAdapter()
          Creates a new CLEFMySQLAdapter.
 
Method Summary
protected  recoinx.clef.CLEFResultList createResultList(java.sql.ResultSet results)
          Creates a new CLEFResultList using the results in the specified ResultSet.
protected  recoinx.clef.CLEFResultList executeQuery(java.lang.String query, int table)
          Executes the specified query according to the specified table and returns the results in a CLEFResultList.
 void initiate(recoin.group.Component c)
          Initiates this CLEFMySQLAdapter by passing the specified Component to the superclass's initiate() method and by initiating the attributes.
protected  java.lang.String[] tokenizeQueryString(java.lang.String queryString)
          Returns a String[] that contains the tokens, i.e.
 
Methods inherited from class recoin.group.adapter.JDBCSingleAdapter
getConnection, getConnection
 
Methods inherited from class recoin.group.ComponentWorker
createComponentRunnable, createComponentRunnable, createComponentRunnable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
The logger of this class.


statement

private java.sql.PreparedStatement statement
A PreparedStatement.


normalize

protected boolean normalize
Flag to signal whether any results should be normalized.

This parameter is overwritten if a an attribute with the same name exists in the repository for this Component. Default is 'false'.


merge

protected boolean merge
Flag to signal whether any results from the different collections should be merged into one CLEFResultList or added to the container separately.

This parameter is overwritten if a an attribute with the same name exists in the repository for this Component. Default is 'true'.


tables

protected int[] tables
The static int values of the collections to search.

Constructor Detail

CLEFMySQLAdapter

public CLEFMySQLAdapter()
Creates a new CLEFMySQLAdapter.

Method Detail

initiate

public void initiate(recoin.group.Component c)
              throws recoin.exception.InitiationException
Initiates this CLEFMySQLAdapter by passing the specified Component to the superclass's initiate() method and by initiating the attributes. A Connection to the database is established as well.


executeQuery

protected recoinx.clef.CLEFResultList executeQuery(java.lang.String query,
                                                   int table)
                                            throws java.sql.SQLException
Executes the specified query according to the specified table and returns the results in a CLEFResultList.

The specified table and query are used to assemble and compile a PreparedStatement which is executed. The results are stored in a CLEFResultList that has its attributes set to represent the collection the results were found in.


createResultList

protected recoinx.clef.CLEFResultList createResultList(java.sql.ResultSet results)
Creates a new CLEFResultList using the results in the specified ResultSet.


tokenizeQueryString

protected java.lang.String[] tokenizeQueryString(java.lang.String queryString)
Returns a String[] that contains the tokens, i.e. single words from the specified query string.