public interface GenOrmDSEnvelope
One of the classes generated is a class called DSEnvelope.
DSEnvelope implements this interface and can be used to pass the
data source to the GenOrmDataSource methods.
Here is some code from one of the unit tests that sets up the data source
jdbcDataSource ds = new jdbcDataSource();
ds.setDatabase("jdbc:hsqldb:file:"+m_databaseDir+"/testdb");
ds.setUser("sa");
ds.setPassword("");
//Test the connection
Connection c = ds.getConnection();
assertNotNull(c);
c.close();
m_dataSource = ds;
GenOrmDataSource.setDataSource(new DSEnvelope(m_dataSource));
You can override what key generator is returned by subclassing DSEnvelope
and passing your subclass to GenOrmDataSource
| Modifier and Type | Method and Description |
|---|---|
javax.sql.DataSource |
getDataSource()
Returns the
java.sql.DataSource that is used to create connections
from. |
GenOrmKeyGenerator |
getKeyGenerator(java.lang.String table)
Returns the key generator for the specified table
|
void |
initialize() |
javax.sql.DataSource getDataSource()
java.sql.DataSource that is used to create connections
from.void initialize()
GenOrmKeyGenerator getKeyGenerator(java.lang.String table)