Package org.h2.fulltext
Class FullText.FullTextTrigger
- java.lang.Object
-
- org.h2.fulltext.FullText.FullTextTrigger
-
-
Field Summary
Fields Modifier and Type Field Description private int[]columnTypesprivate static intDELETE_MAPprivate static intDELETE_ROWprivate IndexInfoindexprivate static intINSERT_MAPprivate static intINSERT_ROWprivate static intINSERT_WORDprivate static intSELECT_ROWprivate FullTextSettingssettingprivate static java.lang.String[]SQL
-
Constructor Summary
Constructors Constructor Description FullTextTrigger()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()INTERNALprivate voiddelete(java.sql.Connection conn, java.lang.Object[] row)Delete a row from the index.voidfire(java.sql.Connection conn, java.lang.Object[] oldRow, java.lang.Object[] newRow)INTERNALprivate java.lang.StringgetKey(java.lang.Object[] row)private static java.sql.PreparedStatementgetStatement(java.sql.Connection conn, int index)private int[]getWordIds(java.sql.Connection conn, java.lang.Object[] row)voidinit(java.sql.Connection conn, java.lang.String schemaName, java.lang.String triggerName, java.lang.String tableName, boolean before, int type)INTERNALprivate voidinsert(java.sql.Connection conn, java.lang.Object[] row)Add a row to the index.voidremove()INTERNAL
-
-
-
Field Detail
-
setting
private FullTextSettings setting
-
index
private IndexInfo index
-
columnTypes
private int[] columnTypes
-
INSERT_WORD
private static final int INSERT_WORD
- See Also:
- Constant Field Values
-
INSERT_ROW
private static final int INSERT_ROW
- See Also:
- Constant Field Values
-
INSERT_MAP
private static final int INSERT_MAP
- See Also:
- Constant Field Values
-
DELETE_ROW
private static final int DELETE_ROW
- See Also:
- Constant Field Values
-
DELETE_MAP
private static final int DELETE_MAP
- See Also:
- Constant Field Values
-
SELECT_ROW
private static final int SELECT_ROW
- See Also:
- Constant Field Values
-
SQL
private static final java.lang.String[] SQL
-
-
Method Detail
-
init
public void init(java.sql.Connection conn, java.lang.String schemaName, java.lang.String triggerName, java.lang.String tableName, boolean before, int type) throws java.sql.SQLExceptionINTERNAL- Specified by:
initin interfaceTrigger- Parameters:
conn- a connection to the database (a system connection)schemaName- the name of the schematriggerName- the name of the trigger used in the CREATE TRIGGER statementtableName- the name of the tablebefore- whether the fire method is called before or after the operation is performedtype- the operation type: INSERT, UPDATE, DELETE, SELECT, or a combination (this parameter is a bit field)- Throws:
java.sql.SQLException- on SQL exception- See Also:
Trigger.init(Connection, String, String, String, boolean, int)
-
fire
public void fire(java.sql.Connection conn, java.lang.Object[] oldRow, java.lang.Object[] newRow) throws java.sql.SQLExceptionINTERNAL- Specified by:
firein interfaceTrigger- Parameters:
conn- a connection to the databaseoldRow- the old row, or null if no old row is available (for INSERT)newRow- the new row, or null if no new row is available (for DELETE)- Throws:
java.sql.SQLException- if the operation must be undone- See Also:
Trigger.fire(Connection, Object[], Object[])
-
insert
private void insert(java.sql.Connection conn, java.lang.Object[] row) throws java.sql.SQLExceptionAdd a row to the index.- Parameters:
conn- to userow- the row- Throws:
java.sql.SQLException- on failure
-
delete
private void delete(java.sql.Connection conn, java.lang.Object[] row) throws java.sql.SQLExceptionDelete a row from the index.- Parameters:
conn- to userow- the row- Throws:
java.sql.SQLException- on failure
-
getWordIds
private int[] getWordIds(java.sql.Connection conn, java.lang.Object[] row) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getKey
private java.lang.String getKey(java.lang.Object[] row) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getStatement
private static java.sql.PreparedStatement getStatement(java.sql.Connection conn, int index) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
-