mybatis / old-google-code-issues

Automatically exported from code.google.com/p/mybatis
2 stars 4 forks source link

mybatis generator generates incorrect-formatted element "$orderByClause$" #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.

I'm using Mybatis-3.0.2 together with mybatis-generator-core-1.3.0.

There is a parsing error of the element "SelectByExampleWithBLOBs" in the 
generated SqlMapper XML file, the related code is:
mybatis/generator/codegen/mybatis3/xmlmapper/elements/SelectByExampleWithBLOBsEl
ementGenerator.java:77:        ifElement.addElement(new TextElement("order by 
$orderByClause$")); //$NON-NLS-1$

while its counterpart which incurs no parsing error is:
mybatis/generator/codegen/mybatis3/xmlmapper/elements/SelectByExampleWithoutBLOB
sElementGenerator.java:74:        ifElement.addElement(new TextElement("order 
by ${orderByClause}")); //$NON-NLS-1$

I tried to `grep -P -r '\$\w+\$' *` in the root directory of the generator 
project, and the results are:
mybatis/generator/codegen/ibatis2/sqlmap/elements/SelectByExampleWithBLOBsElemen
tGenerator.java:                .addElement(new TextElement("order by 
$orderByClause$")); //$NON-NLS-1$
mybatis/generator/codegen/ibatis2/sqlmap/elements/SelectByExampleWithoutBLOBsEle
mentGenerator.java:                .addElement(new TextElement("order by 
$orderByClause$")); //$NON-NLS-1$
mybatis/generator/codegen/mybatis3/xmlmapper/elements/SelectByExampleWithBLOBsEl
ementGenerator.java:        ifElement.addElement(new TextElement("order by 
$orderByClause$")); //$NON-NLS-1$

Is it a bug or did I make mistakes somewhere?

Thanks!

Original issue reported on code.google.com by zsuli...@gmail.com on 13 Nov 2010 at 2:09

GoogleCodeExporter commented 9 years ago
Hi
I had the problem too.
It should be changed in ...codegen/mybatis3/... to "order by ${orderByClause}".

Original comment by adrien.c...@gmail.com on 9 Dec 2010 at 4:00

GoogleCodeExporter commented 9 years ago

Original comment by jeffgbut...@gmail.com on 11 Dec 2010 at 12:06

GoogleCodeExporter commented 9 years ago
Fixed in SVN for generator 1.3.1.  Thanks for reporting.

Original comment by jeffgbut...@gmail.com on 12 Dec 2010 at 10:09