OpenGamma / ElSql

Manage external SQL files in Java with a little DSL goodness
Other
101 stars 26 forks source link

Issue #8 - add @EQUALS that generates = or IS NULL #9

Closed andrewdmay closed 9 years ago

andrewdmay commented 10 years ago

Adds an @EQUALS/@ENDEQUALS pair similar to @LIKE\@ENDLIKE that determines whether to use the '=' operator or 'IS NULL' depending upon the value of the bound variable in the parameter source.

Also added null handling to @LIKE to output 'IS NULL' if the bound variable is null.

Because of the similarities between like and equals, created an OperatorSqlFragment superclass that reduces the code duplication in the fragment classes and the parser.

jodastephen commented 10 years ago

Thanks for the pull request. I've just realised that this code requires you to sign a copyright assignment in order for us to accept the pull request. Details are here, even though the page refers to the platform rather than ElSql. Let us know if it is difficult for you to sign. thanks

andrewdmay commented 10 years ago

I've completed and emailed the contributor assignment agreement. Let me know if there are any changes that need to be made to the code - for example adding the standard copyright to the start of the new files.

jodastephen commented 9 years ago

Could you add the standard license header to the one new file, and then I'll merge, thanks