Class DatabaseManagerImpl
- java.lang.Object
-
- net.didion.jwnl.dictionary.database.DatabaseManagerImpl
-
- All Implemented Interfaces:
DatabaseManager,Createable
- Direct Known Subclasses:
SenseAndUsageDatabaseManager
public class DatabaseManagerImpl extends java.lang.Object implements DatabaseManager, Createable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classDatabaseManagerImpl.MinMax
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionManager_connectionManagerprotected java.util.Map_minMaxIdsprotected static java.util.Random_randprotected static java.lang.StringALL_EXCEPTIONS_SQLprotected static java.lang.StringALL_LEMMAS_LIKE_SQLprotected static java.lang.StringALL_LEMMAS_SQLprotected static java.lang.StringALL_SYNSETS_SQLprotected static java.lang.StringCOUNT_INDEX_WORDS_SQLstatic java.lang.StringDRIVERprotected static java.lang.StringEXCEPTION_SQLstatic java.lang.StringJNDIprotected static java.lang.StringLEMMA_FOR_INDEX_WORD_ID_SQLstatic java.lang.StringPASSWORDprotected static java.lang.StringSYNSET_IDS_FOR_INDEX_WORD_SQLSQL query for getting all synsets for an index word.protected static java.lang.StringSYNSET_POINTER_SQLprotected static java.lang.StringSYNSET_SQLprotected static java.lang.StringSYNSET_VERB_FRAME_SQLprotected static java.lang.StringSYNSET_WORD_SQLstatic java.lang.StringURLstatic java.lang.StringUSERNAME
-
Constructor Summary
Constructors Constructor Description DatabaseManagerImpl()DatabaseManagerImpl(ConnectionManager connectionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcreate(java.util.Map params)protected QuerycreatePOSIdQuery(POS pos, int id, java.lang.String sql)protected QuerycreatePOSOffsetQuery(POS pos, long offset, java.lang.String sql)protected QuerycreatePOSQuery(POS pos, java.lang.String sql)protected QuerycreatePOSStringQuery(POS pos, java.lang.String str, java.lang.String sql)QuerygetExceptionQuery(POS pos, java.lang.String derivation)QuerygetExceptionsQuery(POS pos)QuerygetIndexWordLemmasQuery(POS pos)QuerygetIndexWordLemmasQuery(POS pos, java.lang.String substring)QuerygetIndexWordSynsetsQuery(POS pos, java.lang.String lemma)QuerygetPointerQuery(POS pos, long offset)QuerygetRandomIndexWordQuery(POS pos)QuerygetSynsetQuery(POS pos, long offset)QuerygetSynsetsQuery(POS pos)QuerygetSynsetWordQuery(POS pos, long offset)QuerygetVerbFrameQuery(POS pos, long offset)
-
-
-
Field Detail
-
DRIVER
public static final java.lang.String DRIVER
- See Also:
- Constant Field Values
-
URL
public static final java.lang.String URL
- See Also:
- Constant Field Values
-
USERNAME
public static final java.lang.String USERNAME
- See Also:
- Constant Field Values
-
PASSWORD
public static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
-
JNDI
public static final java.lang.String JNDI
- See Also:
- Constant Field Values
-
LEMMA_FOR_INDEX_WORD_ID_SQL
protected static final java.lang.String LEMMA_FOR_INDEX_WORD_ID_SQL
- See Also:
- Constant Field Values
-
SYNSET_IDS_FOR_INDEX_WORD_SQL
protected static final java.lang.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 java.lang.String COUNT_INDEX_WORDS_SQL
- See Also:
- Constant Field Values
-
ALL_LEMMAS_SQL
protected static final java.lang.String ALL_LEMMAS_SQL
- See Also:
- Constant Field Values
-
ALL_LEMMAS_LIKE_SQL
protected static final java.lang.String ALL_LEMMAS_LIKE_SQL
- See Also:
- Constant Field Values
-
SYNSET_SQL
protected static final java.lang.String SYNSET_SQL
- See Also:
- Constant Field Values
-
SYNSET_WORD_SQL
protected static final java.lang.String SYNSET_WORD_SQL
- See Also:
- Constant Field Values
-
SYNSET_POINTER_SQL
protected static final java.lang.String SYNSET_POINTER_SQL
- See Also:
- Constant Field Values
-
SYNSET_VERB_FRAME_SQL
protected static final java.lang.String SYNSET_VERB_FRAME_SQL
- See Also:
- Constant Field Values
-
ALL_SYNSETS_SQL
protected static final java.lang.String ALL_SYNSETS_SQL
- See Also:
- Constant Field Values
-
EXCEPTION_SQL
protected static final java.lang.String EXCEPTION_SQL
- See Also:
- Constant Field Values
-
ALL_EXCEPTIONS_SQL
protected static final java.lang.String ALL_EXCEPTIONS_SQL
- See Also:
- Constant Field Values
-
_rand
protected static final java.util.Random _rand
-
_connectionManager
protected ConnectionManager _connectionManager
-
_minMaxIds
protected java.util.Map _minMaxIds
-
-
Constructor Detail
-
DatabaseManagerImpl
public DatabaseManagerImpl()
-
DatabaseManagerImpl
public DatabaseManagerImpl(ConnectionManager connectionManager)
-
-
Method Detail
-
create
public java.lang.Object create(java.util.Map params) throws JWNLException- Specified by:
createin interfaceCreateable- Throws:
JWNLException
-
getIndexWordSynsetsQuery
public Query getIndexWordSynsetsQuery(POS pos, java.lang.String lemma) throws JWNLException
- Specified by:
getIndexWordSynsetsQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getIndexWordLemmasQuery
public Query getIndexWordLemmasQuery(POS pos) throws JWNLException
- Specified by:
getIndexWordLemmasQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getIndexWordLemmasQuery
public Query getIndexWordLemmasQuery(POS pos, java.lang.String substring) throws JWNLException
- Specified by:
getIndexWordLemmasQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getRandomIndexWordQuery
public Query getRandomIndexWordQuery(POS pos) throws JWNLException
- Specified by:
getRandomIndexWordQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getSynsetQuery
public Query getSynsetQuery(POS pos, long offset) throws JWNLException
- Specified by:
getSynsetQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getSynsetWordQuery
public Query getSynsetWordQuery(POS pos, long offset) throws JWNLException
- Specified by:
getSynsetWordQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getPointerQuery
public Query getPointerQuery(POS pos, long offset) throws JWNLException
- Specified by:
getPointerQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getVerbFrameQuery
public Query getVerbFrameQuery(POS pos, long offset) throws JWNLException
- Specified by:
getVerbFrameQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getSynsetsQuery
public Query getSynsetsQuery(POS pos) throws JWNLException
- Specified by:
getSynsetsQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getExceptionQuery
public Query getExceptionQuery(POS pos, java.lang.String derivation) throws JWNLException
- Specified by:
getExceptionQueryin interfaceDatabaseManager- Throws:
JWNLException
-
getExceptionsQuery
public Query getExceptionsQuery(POS pos) throws JWNLException
- Specified by:
getExceptionsQueryin interfaceDatabaseManager- Throws:
JWNLException
-
createPOSQuery
protected Query createPOSQuery(POS pos, java.lang.String sql) throws JWNLException
- Throws:
JWNLException
-
createPOSStringQuery
protected Query createPOSStringQuery(POS pos, java.lang.String str, java.lang.String sql) throws JWNLException
- Throws:
JWNLException
-
createPOSOffsetQuery
protected Query createPOSOffsetQuery(POS pos, long offset, java.lang.String sql) throws JWNLException
- Throws:
JWNLException
-
createPOSIdQuery
protected Query createPOSIdQuery(POS pos, int id, java.lang.String sql) throws JWNLException
- Throws:
JWNLException
-
-