private SqlQueryResult executeQuery(final Domain domain, final String sql)
     throws SQLException, Exception {
   final SqlConnection connection = dataBaseManager.getConnectionProvider().obtainConnection();
   try (final SqlPreparedStatement preparedStatement =
       dataBaseManager.createPreparedStatement(connection, sql, false)) {
     preparedStatement.init();
     return preparedStatement.executeQuery(domain);
   } finally {
     connection.commit();
   }
 }
 /** {@inheritDoc} */
 @Override
 public int doExecute(final SqlConnection connection, final SqlPreparedStatement statement)
     throws SQLException {
   setInParameters(statement);
   final int sqlRowcount = statement.executeUpdate();
   setOutParameters(statement);
   return sqlRowcount;
 }
  private void setOutParameters(final SqlPreparedStatement statement) throws SQLException {
    // gestion de generatedKey
    final DtObject dto = (DtObject) getValue("DTO");
    final DtDefinition dtDefinition = DtObjectUtil.findDtDefinition(dto);
    final DtField pk = dtDefinition.getIdField().get();

    final Object key = statement.getGeneratedKey(pk.getName(), pk.getDomain());
    pk.getDataAccessor().setValue(dto, key);
  }