Skip to content

Example

Stephen Colebourne edited this page Oct 6, 2015 · 4 revisions

ElSql was built as part of OpenGamma, the open source platform for financial analytics. As such, there is lots of available open source code to learn from.

Insert example

This example looks at the insertion of a document into two tables in the database.

The named blocks being used are "Insert" and "InsertDate". The basic SQL in those blocks should be simple enough to understand as there are no special embedded tags.

The source code sets up the SqlParameterSource and then calls getElSqlBundle().getSql("Insert", docArgs); to obtain the named block of SQL. This is then simply used as SQL to pass to Spring's NamedParameterJdbcTemplate.


Home

Clone this wiki locally