org.eclipse.net4j.spi.db
Class DBSchema

java.lang.Object
  extended by org.eclipse.net4j.internal.db.ddl.DBSchemaElement
      extended by org.eclipse.net4j.spi.db.DBSchema
All Implemented Interfaces:
IDBSchema, IDBSchemaElement

public class DBSchema
extends org.eclipse.net4j.internal.db.ddl.DBSchemaElement
implements IDBSchema

A useful base class for implementing custom DB schemas.


Constructor Summary
DBSchema(String name)
           
 
Method Summary
 IDBTable addTable(String name)
           
 void assertUnlocked()
           
 Set<IDBTable> create(IDBAdapter dbAdapter, Connection connection)
           
 Set<IDBTable> create(IDBAdapter dbAdapter, DataSource dataSource)
           
 Set<IDBTable> create(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider)
           
 void drop(IDBAdapter dbAdapter, Connection connection)
           
 void drop(IDBAdapter dbAdapter, DataSource dataSource)
           
 void drop(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider)
           
 void export(Connection connection, PrintStream out)
           
 void export(DataSource dataSource, PrintStream out)
           
 void export(IDBConnectionProvider connectionProvider, PrintStream out)
           
 String getFullName()
           
 String getName()
           
 IDBSchema getSchema()
           
 IDBTable getTable(String name)
           
 IDBTable[] getTables()
           
 boolean isLocked()
           
 boolean lock()
           
 IDBTable removeTable(String name)
           
 
Methods inherited from class org.eclipse.net4j.internal.db.ddl.DBSchemaElement
getProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.net4j.db.ddl.IDBSchemaElement
getProperties
 

Constructor Detail

DBSchema

public DBSchema(String name)
Method Detail

getFullName

public String getFullName()
Specified by:
getFullName in interface IDBSchemaElement

getSchema

public IDBSchema getSchema()
Specified by:
getSchema in interface IDBSchemaElement

getName

public String getName()
Specified by:
getName in interface IDBSchemaElement

addTable

public IDBTable addTable(String name)
                  throws DBException
Specified by:
addTable in interface IDBSchema
Throws:
DBException
Since:
2.0

removeTable

public IDBTable removeTable(String name)
Specified by:
removeTable in interface IDBSchema
Since:
4.0

getTable

public IDBTable getTable(String name)
Specified by:
getTable in interface IDBSchema
Since:
2.0

getTables

public IDBTable[] getTables()
Specified by:
getTables in interface IDBSchema
Since:
2.0

isLocked

public boolean isLocked()

lock

public boolean lock()

create

public Set<IDBTable> create(IDBAdapter dbAdapter,
                            Connection connection)
                     throws DBException
Specified by:
create in interface IDBSchema
Throws:
DBException

create

public Set<IDBTable> create(IDBAdapter dbAdapter,
                            DataSource dataSource)
                     throws DBException
Specified by:
create in interface IDBSchema
Throws:
DBException

create

public Set<IDBTable> create(IDBAdapter dbAdapter,
                            IDBConnectionProvider connectionProvider)
                     throws DBException
Specified by:
create in interface IDBSchema
Throws:
DBException

drop

public void drop(IDBAdapter dbAdapter,
                 Connection connection)
          throws DBException
Specified by:
drop in interface IDBSchema
Throws:
DBException

drop

public void drop(IDBAdapter dbAdapter,
                 DataSource dataSource)
          throws DBException
Specified by:
drop in interface IDBSchema
Throws:
DBException

drop

public void drop(IDBAdapter dbAdapter,
                 IDBConnectionProvider connectionProvider)
          throws DBException
Specified by:
drop in interface IDBSchema
Throws:
DBException

export

public void export(Connection connection,
                   PrintStream out)
            throws DBException
Specified by:
export in interface IDBSchema
Throws:
DBException

export

public void export(DataSource dataSource,
                   PrintStream out)
            throws DBException
Specified by:
export in interface IDBSchema
Throws:
DBException

export

public void export(IDBConnectionProvider connectionProvider,
                   PrintStream out)
            throws DBException
Specified by:
export in interface IDBSchema
Throws:
DBException

assertUnlocked

public void assertUnlocked()
                    throws DBException
Throws:
DBException


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.