public class DatabaseManagerImpl extends java.lang.Object implements DatabaseManager
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALL_EXCEPTIONS_SQL |
protected static java.lang.String |
ALL_LEMMAS_LIKE_SQL |
protected static java.lang.String |
ALL_LEMMAS_SQL |
protected static java.lang.String |
ALL_SYNSETS_SQL |
protected ConnectionManager |
connectionManager |
protected static java.lang.String |
COUNT_INDEX_WORDS_SQL |
protected Dictionary |
dictionary |
static java.lang.String |
DRIVER |
protected static java.lang.String |
EXCEPTION_SQL |
protected static java.lang.String |
LEMMA_FOR_INDEX_WORD_ID_SQL |
protected java.util.Map<POS,net.sf.extjwnl.dictionary.database.DatabaseManagerImpl.MinMax> |
minMaxIds |
static java.lang.String |
PASSWORD |
protected static java.util.Random |
rand |
protected static java.lang.String |
SYNSET_IDS_FOR_INDEX_WORD_SQL
SQL query for getting all synsets for an index word.
|
protected static java.lang.String |
SYNSET_POINTER_SQL |
protected static java.lang.String |
SYNSET_SQL |
protected static java.lang.String |
SYNSET_VERB_FRAME_SQL |
protected static java.lang.String |
SYNSET_WORD_SQL |
static java.lang.String |
URL |
static java.lang.String |
USERNAME |
Constructor and Description |
---|
DatabaseManagerImpl(Dictionary dictionary,
java.util.Map<java.lang.String,Param> params) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connections and frees associated resources.
|
protected Query |
createPOSIdQuery(POS pos,
int id,
java.lang.String sql) |
protected Query |
createPOSOffsetQuery(POS pos,
long offset,
java.lang.String sql) |
protected Query |
createPOSQuery(POS pos,
java.lang.String sql) |
protected Query |
createPOSStringQuery(POS pos,
java.lang.String str,
java.lang.String sql) |
Dictionary |
getDictionary()
Returns the dictionary this object belongs to.
|
Query |
getExceptionQuery(POS pos,
java.lang.String derivation) |
Query |
getExceptionsQuery(POS pos) |
Query |
getIndexWordLemmasQuery(POS pos) |
Query |
getIndexWordLemmasQuery(POS pos,
java.lang.String substring) |
Query |
getIndexWordSynsetsQuery(POS pos,
java.lang.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) |
void |
setDictionary(Dictionary dictionary)
Sets the dictionary this object belongs to.
|
public static final java.lang.String DRIVER
public static final java.lang.String URL
public static final java.lang.String USERNAME
public static final java.lang.String PASSWORD
protected static final java.lang.String LEMMA_FOR_INDEX_WORD_ID_SQL
protected static final java.lang.String SYNSET_IDS_FOR_INDEX_WORD_SQL
protected static final java.lang.String COUNT_INDEX_WORDS_SQL
protected static final java.lang.String ALL_LEMMAS_SQL
protected static final java.lang.String ALL_LEMMAS_LIKE_SQL
protected static final java.lang.String SYNSET_SQL
protected static final java.lang.String SYNSET_WORD_SQL
protected static final java.lang.String SYNSET_POINTER_SQL
protected static final java.lang.String SYNSET_VERB_FRAME_SQL
protected static final java.lang.String ALL_SYNSETS_SQL
protected static final java.lang.String EXCEPTION_SQL
protected static final java.lang.String ALL_EXCEPTIONS_SQL
protected static final java.util.Random rand
protected final ConnectionManager connectionManager
protected final java.util.Map<POS,net.sf.extjwnl.dictionary.database.DatabaseManagerImpl.MinMax> minMaxIds
protected final Dictionary dictionary
public DatabaseManagerImpl(Dictionary dictionary, java.util.Map<java.lang.String,Param> params) throws java.sql.SQLException
java.sql.SQLException
public Query getIndexWordSynsetsQuery(POS pos, java.lang.String lemma) throws java.sql.SQLException
getIndexWordSynsetsQuery
in interface DatabaseManager
java.sql.SQLException
public Query getIndexWordLemmasQuery(POS pos) throws java.sql.SQLException
getIndexWordLemmasQuery
in interface DatabaseManager
java.sql.SQLException
public Query getIndexWordLemmasQuery(POS pos, java.lang.String substring) throws java.sql.SQLException
getIndexWordLemmasQuery
in interface DatabaseManager
java.sql.SQLException
public Query getRandomIndexWordQuery(POS pos) throws java.sql.SQLException
getRandomIndexWordQuery
in interface DatabaseManager
java.sql.SQLException
public Query getSynsetQuery(POS pos, long offset) throws java.sql.SQLException
getSynsetQuery
in interface DatabaseManager
java.sql.SQLException
public Query getSynsetWordQuery(POS pos, long offset) throws java.sql.SQLException
getSynsetWordQuery
in interface DatabaseManager
java.sql.SQLException
public Query getPointerQuery(POS pos, long offset) throws java.sql.SQLException
getPointerQuery
in interface DatabaseManager
java.sql.SQLException
public Query getVerbFrameQuery(POS pos, long offset) throws java.sql.SQLException
getVerbFrameQuery
in interface DatabaseManager
java.sql.SQLException
public Query getSynsetsQuery(POS pos) throws java.sql.SQLException
getSynsetsQuery
in interface DatabaseManager
java.sql.SQLException
public Query getExceptionQuery(POS pos, java.lang.String derivation) throws java.sql.SQLException
getExceptionQuery
in interface DatabaseManager
java.sql.SQLException
public Query getExceptionsQuery(POS pos) throws java.sql.SQLException
getExceptionsQuery
in interface DatabaseManager
java.sql.SQLException
public void close()
DatabaseManager
close
in interface DatabaseManager
protected Query createPOSQuery(POS pos, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected Query createPOSStringQuery(POS pos, java.lang.String str, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected Query createPOSOffsetQuery(POS pos, long offset, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
protected Query createPOSIdQuery(POS pos, int id, java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public Dictionary getDictionary()
Owned
getDictionary
in interface Owned
public void setDictionary(Dictionary dictionary)
Owned
setDictionary
in interface Owned
dictionary
- the dictionary this object belongs to