Class IndexedDBView

java.lang.Object
overit.geocall.sql.DBView
overit.geocall.sql.IndexedDBView
All Implemented Interfaces:
Serializable, JsonSerializable, DBFieldMapper, DBObjectMapper

public class IndexedDBView extends DBView
This class manages the creation of an indexed DBView
See Also:
  • Constructor Details

    • IndexedDBView

      public IndexedDBView(DBView dbv)
      Main constructor for the IndexedDBView
      Parameters:
      dbv - The DBView
  • Method Details

    • createIndex

      public void createIndex(String indexName, String fieldName)
      Creates the index
      Parameters:
      indexName - The name of the index
      fieldName - The name of the field
    • useIndex

      public void useIndex(String indexName)
      Uses the index
      Parameters:
      indexName - The name of the index
    • seek

      public int seek(Object value)
      Search a value
      Parameters:
      value - The value to search
      Returns:
      The position of the value
    • dropIndex

      public void dropIndex(String indexName)
      Drop the index
      Parameters:
      indexName - The name of the index
    • delete

      public void delete(int i)
      Description copied from class: DBView
      Removes a row from the DBView
      Overrides:
      delete in class DBView
      Parameters:
      i - The number that identifies the position of the row to be removed from the DBView
    • insert

      public void insert(Map m)
      Description copied from class: DBView
      Insert a row as the last row of the DBView
      Overrides:
      insert in class DBView
      Parameters:
      m - The map that defines the row that must be inserted
    • insert

      public void insert(int pos, Map m)
      Description copied from class: DBView
      Insert a row into a specific position of the DBView
      Overrides:
      insert in class DBView
      Parameters:
      pos - The position in which we want to insert the row (null to insert as the last row)
      m - The map that defines the row that must be inserted
    • append

      public void append(ResultSet rs) throws SQLException
      Description copied from class: DBView
      Append the ResultSet to the DBView
      Overrides:
      append in class DBView
      Parameters:
      rs - The ResultSet to append
      Throws:
      SQLException - If a database access error occurs, or this method is called on a closed result set, an SQLException is raised
    • append

      public void append(DBView dbv)
      Description copied from class: DBView
      Append a DBView to the current one
      Overrides:
      append in class DBView
      Parameters:
      dbv - The DBView to append
    • append

      public void append(ArrayList l)
      Description copied from class: DBView
      Append a row as the last row of the DBView
      Overrides:
      append in class DBView
      Parameters:
      l - The ArrayList that defines the row to append
    • update

      public void update(int pos, Map m)
      Description copied from class: DBView
      Updates a row of the DBView
      Overrides:
      update in class DBView
      Parameters:
      pos - The position of the row to update
      m - The map that contains the new values for the row
    • set

      public void set(int row, String field, Object o)
      Description copied from class: DBView
      Sets an object to a field in a specific row
      Overrides:
      set in class DBView
      Parameters:
      row - The number that identifies the position of the row in the DBView
      field - The name of the field
      o - The object to set
    • put

      public Object put(int row, String field, Object value)
      Description copied from class: DBView
      Puts an object to a field in a specific row
      Overrides:
      put in class DBView
      Parameters:
      row - The number that identifies the position of the row in the DBView
      field - The name of the field
      value - The object to set
      Returns:
      The object previously at the specified position
    • setAutoBuild

      public void setAutoBuild(boolean autoBuild)
      Sets the auto build capability
      Parameters:
      autoBuild - Boolean value indicating if the auto build capability should be enabled
    • getAutoBuild

      public boolean getAutoBuild()
      Returns true if the auto build capability is enabled, false otherwise
      Returns:
      true if the auto build capability is enabled, false otherwise
    • applyChanges

      public void applyChanges()
      Description copied from class: DBView
      Makes the changes (insertions, updates and deletions) effective
      Overrides:
      applyChanges in class DBView
    • buildIndex

      protected void buildIndex(overit.geocall.sql.IndexedDBView.Index idx)
    • buildIndexes

      public void buildIndexes()
      Build the indexes