org.openrdf.sail.rdbms.schema
Class RdbmsTable

java.lang.Object
  extended by org.openrdf.sail.rdbms.schema.RdbmsTable
Direct Known Subclasses:
MySqlTable, PgSqlTable

public class RdbmsTable
extends Object

Represents and controls the underlying database table.

Author:
James Leigh

Field Summary
static int MAX_DELTA_TO_FORCE_OPTIMIZE
           
static int total_opt
           
 
Constructor Summary
RdbmsTable(String name)
           
 
Method Summary
 int[] aggregate(String... expressions)
           
protected  String buildClear()
           
protected  String buildCreateTable(CharSequence columns)
           
protected  String buildCreateTemporaryTable(CharSequence columns)
           
protected  String buildCreateTransactionalTable(CharSequence columns)
           
protected  String buildDropIndex(String name)
           
protected  String buildIndex(String... columns)
           
protected  String buildIndexName(String... columns)
          Creates an index name based on the name of the columns and table that it's supposed to index.
protected  String buildLongIndex(String... columns)
           
protected  String buildOptimize()
           
protected  String buildPrimaryIndex(String... columns)
           
 void clear()
           
 void close()
           
 long count()
           
 void createTable(CharSequence columns)
           
 void createTemporaryTable(CharSequence columns)
           
 void createTransactionalTable(CharSequence columns)
           
 void drop()
           
 void dropIndex(String name)
           
 boolean equals(Object obj)
           
 void execute(String command)
           
 int executeUpdate(String command, Object... parameters)
           
 String getCatalog()
           
 Map<String,List<String>> getIndexes()
           
 String getName()
           
 String getSchema()
           
 int hashCode()
           
 void index(String... columns)
           
 boolean isCreated()
           
 void modified(int inserted, int deleted)
           
 void optimize()
           
protected  boolean optimize(int delta, long rowCount)
           
 PreparedStatement prepareStatement(String sql)
           
 void primaryIndex(String... columns)
           
 void rollback()
           
 List<Object[]> select(String... columns)
           
 void setConnection(Connection conn)
           
 long size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

total_opt

public static int total_opt

MAX_DELTA_TO_FORCE_OPTIMIZE

public static int MAX_DELTA_TO_FORCE_OPTIMIZE
Constructor Detail

RdbmsTable

public RdbmsTable(String name)
Method Detail

setConnection

public void setConnection(Connection conn)

close

public void close()
           throws SQLException
Throws:
SQLException

size

public long size()

clear

public void clear()
           throws SQLException
Throws:
SQLException

createTable

public void createTable(CharSequence columns)
                 throws SQLException
Throws:
SQLException

createTransactionalTable

public void createTransactionalTable(CharSequence columns)
                              throws SQLException
Throws:
SQLException

createTemporaryTable

public void createTemporaryTable(CharSequence columns)
                          throws SQLException
Throws:
SQLException

execute

public void execute(String command)
             throws SQLException
Throws:
SQLException

executeUpdate

public int executeUpdate(String command,
                         Object... parameters)
                  throws SQLException
Throws:
SQLException

getCatalog

public String getCatalog()

getName

public String getName()

getSchema

public String getSchema()

primaryIndex

public void primaryIndex(String... columns)
                  throws SQLException
Throws:
SQLException

index

public void index(String... columns)
           throws SQLException
Throws:
SQLException

dropIndex

public void dropIndex(String name)
               throws SQLException
Throws:
SQLException

isCreated

public boolean isCreated()
                  throws SQLException
Throws:
SQLException

getIndexes

public Map<String,List<String>> getIndexes()
                                    throws SQLException
Throws:
SQLException

count

public long count()
           throws SQLException
Throws:
SQLException

modified

public void modified(int inserted,
                     int deleted)
              throws SQLException
Throws:
SQLException

optimize

public void optimize()
              throws SQLException
Throws:
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
Throws:
SQLException

rollback

public void rollback()
              throws SQLException
Throws:
SQLException

select

public List<Object[]> select(String... columns)
                      throws SQLException
Throws:
SQLException

aggregate

public int[] aggregate(String... expressions)
                throws SQLException
Throws:
SQLException

optimize

protected boolean optimize(int delta,
                           long rowCount)

buildClear

protected String buildClear()

buildCreateTable

protected String buildCreateTable(CharSequence columns)

buildCreateTransactionalTable

protected String buildCreateTransactionalTable(CharSequence columns)

buildCreateTemporaryTable

protected String buildCreateTemporaryTable(CharSequence columns)

buildPrimaryIndex

protected String buildPrimaryIndex(String... columns)

buildIndex

protected String buildIndex(String... columns)

buildLongIndex

protected String buildLongIndex(String... columns)

buildDropIndex

protected String buildDropIndex(String name)

buildIndexName

protected String buildIndexName(String... columns)
Creates an index name based on the name of the columns and table that it's supposed to index.


buildOptimize

protected String buildOptimize()
                        throws SQLException
Throws:
SQLException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

drop

public void drop()
          throws SQLException
Throws:
SQLException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2008 Aduna. All Rights Reserved.