Package org.h2.fulltext
Class FullText.FullTextTrigger
java.lang.Object
org.h2.fulltext.FullText.FullTextTrigger
- All Implemented Interfaces:
Trigger
- Enclosing class:
FullText
Trigger updates the index when a inserting, updating, or deleting a row.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
private static final int
private static final int
private IndexInfo
private static final int
private static final int
private static final int
private static final int
private FullTextSettings
private static final String[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
INTERNALprivate void
delete
(Connection conn, Object[] row) Delete a row from the index.void
fire
(Connection conn, Object[] oldRow, Object[] newRow) INTERNALprivate String
private static PreparedStatement
getStatement
(Connection conn, int index) private int[]
getWordIds
(Connection conn, Object[] row) void
init
(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) INTERNALprivate void
insert
(Connection conn, Object[] row) Add a row to the index.void
remove()
INTERNAL
-
Field Details
-
setting
-
index
-
columnTypes
private int[] columnTypes -
INSERT_WORD
private static final int INSERT_WORD- See Also:
-
INSERT_ROW
private static final int INSERT_ROW- See Also:
-
INSERT_MAP
private static final int INSERT_MAP- See Also:
-
DELETE_ROW
private static final int DELETE_ROW- See Also:
-
DELETE_MAP
private static final int DELETE_MAP- See Also:
-
SELECT_ROW
private static final int SELECT_ROW- See Also:
-
SQL
-
-
Constructor Details
-
FullTextTrigger
public FullTextTrigger()
-
-
Method Details
-
init
public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) throws SQLException INTERNAL- Specified by:
init
in 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:
SQLException
- on SQL exception- See Also:
-
fire
INTERNAL- Specified by:
fire
in 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:
SQLException
- if the operation must be undone- See Also:
-
close
public void close()INTERNAL -
remove
public void remove()INTERNAL -
insert
Add a row to the index.- Parameters:
conn
- to userow
- the row- Throws:
SQLException
- on failure
-
delete
Delete a row from the index.- Parameters:
conn
- to userow
- the row- Throws:
SQLException
- on failure
-
getWordIds
- Throws:
SQLException
-
getKey
- Throws:
SQLException
-
getStatement
- Throws:
SQLException
-