id uniqueness validation fails in H2 file or memory database
In the simple test app below, adding the same name with a capital letter in it, e.g. “W”, does not trigger the not-unique error. This only happens in the H2 database engine, not in MySQL. After adding the lowercase version, the capital letter will trigger the error, e.g. ‘W’->‘W’[no error] and ‘w’->‘W’ [error].
Submitted by Danny Groenewegen on 11 July 2014 at 13:38entity Project{ name : String (id, iderror="Project name already exists." , idemptyerror="Please enter a project name.") } page root(){ for(pr:Project ){ div{ output(pr.name) } } var p := Project{} form{ input(p.name)[placeholder="Enter project name"] submit action{ p.save(); } { "Create Project" } } }
Issue Log
On 11 July 2014 at 14:33 Danny Groenewegen commented:
fixed https://svn.strategoxt.org/websvn/WebDSL/?op=revision&rev=5939&peg=5939
toLowerCase in the Java code was superfluous for MySQL (current collation will lowercase) and breaks the validation in H2 (current collation preserves capitalization)
made new issue for uniqueness differences: https://yellowgrass.org/issue/WebDSL/810
On 11 July 2014 at 14:33 Danny Groenewegen closed this issue.
Log in to post comments