Class FullText.FullTextTrigger

  • All Implemented Interfaces:
    Trigger
    Enclosing class:
    FullText

    public static final class FullText.FullTextTrigger
    extends java.lang.Object
    implements Trigger
    Trigger updates the index when a inserting, updating, or deleting a row.
    • Constructor Summary

      Constructors 
      Constructor Description
      FullTextTrigger()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      INTERNAL
      private void delete​(java.sql.Connection conn, java.lang.Object[] row)
      Delete a row from the index.
      void fire​(java.sql.Connection conn, java.lang.Object[] oldRow, java.lang.Object[] newRow)
      INTERNAL
      private java.lang.String getKey​(java.lang.Object[] row)  
      private static java.sql.PreparedStatement getStatement​(java.sql.Connection conn, int index)  
      private int[] getWordIds​(java.sql.Connection conn, java.lang.Object[] row)  
      void init​(java.sql.Connection conn, java.lang.String schemaName, java.lang.String triggerName, java.lang.String tableName, boolean before, int type)
      INTERNAL
      private void insert​(java.sql.Connection conn, java.lang.Object[] row)
      Add a row to the index.
      void remove()
      INTERNAL
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FullTextTrigger

        public FullTextTrigger()
    • 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.SQLException
        INTERNAL
        Specified by:
        init in interface Trigger
        Parameters:
        conn - a connection to the database (a system connection)
        schemaName - the name of the schema
        triggerName - the name of the trigger used in the CREATE TRIGGER statement
        tableName - the name of the table
        before - whether the fire method is called before or after the operation is performed
        type - 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.SQLException
        INTERNAL
        Specified by:
        fire in interface Trigger
        Parameters:
        conn - a connection to the database
        oldRow - 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[])
      • close

        public void close()
        INTERNAL
        Specified by:
        close in interface Trigger
      • remove

        public void remove()
        INTERNAL
        Specified by:
        remove in interface Trigger
      • insert

        private void insert​(java.sql.Connection conn,
                            java.lang.Object[] row)
                     throws java.sql.SQLException
        Add a row to the index.
        Parameters:
        conn - to use
        row - the row
        Throws:
        java.sql.SQLException - on failure
      • delete

        private void delete​(java.sql.Connection conn,
                            java.lang.Object[] row)
                     throws java.sql.SQLException
        Delete a row from the index.
        Parameters:
        conn - to use
        row - 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