net.didion.jwnl.dictionary.database
Class DatabaseManagerImpl

java.lang.Object
  extended by net.didion.jwnl.dictionary.database.DatabaseManagerImpl
All Implemented Interfaces:
DatabaseManager, Createable
Direct Known Subclasses:
SenseAndUsageDatabaseManager

public class DatabaseManagerImpl
extends Object
implements DatabaseManager, Createable


Field Summary
protected  ConnectionManager _connectionManager
           
protected  Map _minMaxIds
           
protected static Random _rand
           
protected static String ALL_EXCEPTIONS_SQL
           
protected static String ALL_LEMMAS_LIKE_SQL
           
protected static String ALL_LEMMAS_SQL
           
protected static String ALL_SYNSETS_SQL
           
protected static String COUNT_INDEX_WORDS_SQL
           
static String DRIVER
           
protected static String EXCEPTION_SQL
           
static String JNDI
           
protected static String LEMMA_FOR_INDEX_WORD_ID_SQL
           
static String PASSWORD
           
protected static String SYNSET_IDS_FOR_INDEX_WORD_SQL
          SQL query for getting all synsets for an index word.
protected static String SYNSET_POINTER_SQL
           
protected static String SYNSET_SQL
           
protected static String SYNSET_VERB_FRAME_SQL
           
protected static String SYNSET_WORD_SQL
           
static String URL
           
static String USERNAME
           
 
Constructor Summary
DatabaseManagerImpl()
           
DatabaseManagerImpl(ConnectionManager connectionManager)
           
 
Method Summary
 Object create(Map params)
           
protected  Query createPOSIdQuery(POS pos, int id, String sql)
           
protected  Query createPOSOffsetQuery(POS pos, long offset, String sql)
           
protected  Query createPOSQuery(POS pos, String sql)
           
protected  Query createPOSStringQuery(POS pos, String str, String sql)
           
 Query getExceptionQuery(POS pos, String derivation)
           
 Query getExceptionsQuery(POS pos)
           
 Query getIndexWordLemmasQuery(POS pos)
           
 Query getIndexWordLemmasQuery(POS pos, String substring)
           
 Query getIndexWordSynsetsQuery(POS pos, String lemma)
           
 Query getPointerQuery(POS pos, long offset)
           
 Query getRandomIndexWordQuery(POS pos)
           
 Query getSynsetQuery(POS pos, long offset)
           
 Query getSynsetsQuery(POS pos)
           
 Query getSynsetWordQuery(POS pos, long offset)
           
 Query getVerbFrameQuery(POS pos, long offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRIVER

public static final String DRIVER
See Also:
Constant Field Values

URL

public static final String URL
See Also:
Constant Field Values

USERNAME

public static final String USERNAME
See Also:
Constant Field Values

PASSWORD

public static final String PASSWORD
See Also:
Constant Field Values

JNDI

public static final String JNDI
See Also:
Constant Field Values

LEMMA_FOR_INDEX_WORD_ID_SQL

protected static final String LEMMA_FOR_INDEX_WORD_ID_SQL
See Also:
Constant Field Values

SYNSET_IDS_FOR_INDEX_WORD_SQL

protected static final String SYNSET_IDS_FOR_INDEX_WORD_SQL
SQL query for getting all synsets for an index word.

See Also:
Constant Field Values

COUNT_INDEX_WORDS_SQL

protected static final String COUNT_INDEX_WORDS_SQL
See Also:
Constant Field Values

ALL_LEMMAS_SQL

protected static final String ALL_LEMMAS_SQL
See Also:
Constant Field Values

ALL_LEMMAS_LIKE_SQL

protected static final String ALL_LEMMAS_LIKE_SQL
See Also:
Constant Field Values

SYNSET_SQL

protected static final String SYNSET_SQL
See Also:
Constant Field Values

SYNSET_WORD_SQL

protected static final String SYNSET_WORD_SQL
See Also:
Constant Field Values

SYNSET_POINTER_SQL

protected static final String SYNSET_POINTER_SQL
See Also:
Constant Field Values

SYNSET_VERB_FRAME_SQL

protected static final String SYNSET_VERB_FRAME_SQL
See Also:
Constant Field Values

ALL_SYNSETS_SQL

protected static final String ALL_SYNSETS_SQL
See Also:
Constant Field Values

EXCEPTION_SQL

protected static final String EXCEPTION_SQL
See Also:
Constant Field Values

ALL_EXCEPTIONS_SQL

protected static final String ALL_EXCEPTIONS_SQL
See Also:
Constant Field Values

_rand

protected static final Random _rand

_connectionManager

protected ConnectionManager _connectionManager

_minMaxIds

protected Map _minMaxIds
Constructor Detail

DatabaseManagerImpl

public DatabaseManagerImpl()

DatabaseManagerImpl

public DatabaseManagerImpl(ConnectionManager connectionManager)
Method Detail

create

public Object create(Map params)
              throws JWNLException
Specified by:
create in interface Createable
Throws:
JWNLException

getIndexWordSynsetsQuery

public Query getIndexWordSynsetsQuery(POS pos,
                                      String lemma)
                               throws JWNLException
Specified by:
getIndexWordSynsetsQuery in interface DatabaseManager
Throws:
JWNLException

getIndexWordLemmasQuery

public Query getIndexWordLemmasQuery(POS pos)
                              throws JWNLException
Specified by:
getIndexWordLemmasQuery in interface DatabaseManager
Throws:
JWNLException

getIndexWordLemmasQuery

public Query getIndexWordLemmasQuery(POS pos,
                                     String substring)
                              throws JWNLException
Specified by:
getIndexWordLemmasQuery in interface DatabaseManager
Throws:
JWNLException

getRandomIndexWordQuery

public Query getRandomIndexWordQuery(POS pos)
                              throws JWNLException
Specified by:
getRandomIndexWordQuery in interface DatabaseManager
Throws:
JWNLException

getSynsetQuery

public Query getSynsetQuery(POS pos,
                            long offset)
                     throws JWNLException
Specified by:
getSynsetQuery in interface DatabaseManager
Throws:
JWNLException

getSynsetWordQuery

public Query getSynsetWordQuery(POS pos,
                                long offset)
                         throws JWNLException
Specified by:
getSynsetWordQuery in interface DatabaseManager
Throws:
JWNLException

getPointerQuery

public Query getPointerQuery(POS pos,
                             long offset)
                      throws JWNLException
Specified by:
getPointerQuery in interface DatabaseManager
Throws:
JWNLException

getVerbFrameQuery

public Query getVerbFrameQuery(POS pos,
                               long offset)
                        throws JWNLException
Specified by:
getVerbFrameQuery in interface DatabaseManager
Throws:
JWNLException

getSynsetsQuery

public Query getSynsetsQuery(POS pos)
                      throws JWNLException
Specified by:
getSynsetsQuery in interface DatabaseManager
Throws:
JWNLException

getExceptionQuery

public Query getExceptionQuery(POS pos,
                               String derivation)
                        throws JWNLException
Specified by:
getExceptionQuery in interface DatabaseManager
Throws:
JWNLException

getExceptionsQuery

public Query getExceptionsQuery(POS pos)
                         throws JWNLException
Specified by:
getExceptionsQuery in interface DatabaseManager
Throws:
JWNLException

createPOSQuery

protected Query createPOSQuery(POS pos,
                               String sql)
                        throws JWNLException
Throws:
JWNLException

createPOSStringQuery

protected Query createPOSStringQuery(POS pos,
                                     String str,
                                     String sql)
                              throws JWNLException
Throws:
JWNLException

createPOSOffsetQuery

protected Query createPOSOffsetQuery(POS pos,
                                     long offset,
                                     String sql)
                              throws JWNLException
Throws:
JWNLException

createPOSIdQuery

protected Query createPOSIdQuery(POS pos,
                                 int id,
                                 String sql)
                          throws JWNLException
Throws:
JWNLException


Copyright © 2011. All Rights Reserved.