emacarron / old-google-code-issues

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

DTD does not allow content for cache-ref #779

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
3.1.1

Hi,

I would like to create a plugin for the mybatis generator that automatically 
adds a cache-ref element in the sqlMap document. Very similar to the supplied 
CachePlugin.

However it is not possible to add any content to the cache-ref element, not 
even a comment as per the DTD (ie: <!ELEMENT cache-ref EMPTY>).

Would it be possible to modify the DTD to allow the following:

  <cache-ref namespace="com.mycompany.SharedCache">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
  </cache-ref>

I`m not a DTD expert but I believe this would work:
<!ELEMENT cache-ref (#PCDATA)*>

Without that @mbggenerated comment, a new cache-ref element gets added every 
time we run the mybatis generator.

I'm using the maven plugin, but I don't think it matters.

Cheers

Original issue reported on code.google.com by dcende...@gmail.com on 20 Feb 2013 at 1:54

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 5 Mar 2013 at 6:38