Architecture

The architecture of SQLContainer is relatively simple. SQLContainer is the class implementing the Vaadin Container interfaces and providing access to most of the functionality of this add-on. The standard Vaadin Property and Item interfaces have been implementd as the ColumnProperty and RowItem classes. Item IDs are represented by RowId and TemporaryRowId classes. The RowId class is built based on the primary key columns of the connected database table or query result.

In the connection package, the JDBCConnectionPool interface defines the requirements for a connection pool implementation. Two implementations of this interface are provided: SimpleJDBCConnectionPool provides a simple yet very usable implementation to pool and access JDBC connections. J2EEConnectionPool provides means to access J2EE DataSources.

The query package contains the QueryDelegate interface, which defines everything the SQLContainer needs to enable reading and writing data to and from a database. As discussed earlier, two implementations of this interface are provided: TableQuery for automatic read-write support for a database table, and FreeformQuery for customizing the query, sorting, filtering and writing; this is done by implementing relevant methods of the FreeformStatementDelegate interface.

The query package also contains Filter and OrderBy classes which have been written to provide an alternative to the standard Vaadin container filtering and make sorting non-String properties a bit more user friendly.

Finally, the generator package contains a SQLGenerator interface, which defines the kind of queries that are required by the TableQuery class. The provided implementations include support for HSQLDB, MySQL, PostgreSQL ( DefaultSQLGenerator), Oracle ( OracleGenerator) and Microsoft SQL Server ( MSSQLGenerator). A new or modified implementations may be provided to gain compatibility with older versions or other database servers.

For further details, please refer to the SQLContainer API documentation.