xml - How to customise a Mybatis generator file for multiple users? -


is possible create mybatis generator file handles differences in project path many users when file shared in team? example

   <sqlmapgenerator targetpackage="com.x.y.mybatis.mapper"  targetproject="mydir/src/java"> 

so "mydir" varies between users. in fact working on windows, , on linux, path format can differ. there several project path elements sprinkled throughout generator file.

seems need way of referencing environment variables or system properties within xml, i'm not aware of way of doing mybatis.

got it. in generator file, add following -

<generatorconfiguration>      <properties resource="mybatisgenprops.properties"></properties> 

and in mybatisgenprops.properties file add this

project=myprojdir 

then can reference property -

   <sqlmapgenerator targetpackage="com.x.y.mybatis.mapper"  targetproject="${project}/src/java"> 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -