-
Notifications
You must be signed in to change notification settings - Fork 26
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.
This example looks at the insertion of a document into two tables in the database.
- the elsql file focussing on the insert section
- the source code that uses the file
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.