[#2382] Let DAO reference a Configuration instead of an Executor

This commit is contained in:
Lukas Eder 2013-04-06 21:42:06 +02:00
parent 906df54303
commit 6d7eff66ce
2 changed files with 17 additions and 1 deletions

View File

@ -53,6 +53,14 @@ import org.jooq.exception.DataAccessException;
*/
public interface DAO<R extends TableRecord<R>, P, T> {
/**
* Expose the configuration in whose context this <code>DAO</code> is
* operating.
*
* @return the <code>DAO</code>'s underlying <code>Configuration</code>
*/
Configuration configuration();
/**
* Performs an <code>INSERT</code> statement for a given POJO
*

View File

@ -80,12 +80,20 @@ public abstract class DAOImpl<R extends UpdatableRecord<R>, P, T> implements DAO
}
/**
* Inject an attached factory
* Inject a configuration.
* <p>
* This method is maintained to be able to configure a <code>DAO</code>
* using Spring. It is not exposed in the public API.
*/
public final void setConfiguration(Configuration configuration) {
this.configuration = configuration;
}
@Override
public final Configuration configuration() {
return configuration;
}
// -------------------------------------------------------------------------
// XXX: DAO API
// -------------------------------------------------------------------------