generator icon indicating copy to clipboard operation
generator copied to clipboard

java file merge

Open clcy1243 opened this issue 5 years ago • 2 comments

Could u support java file merge? I try write generator plugin to support it, it's painful.

May be I should write a new maven plugin by way of overwrite MavenShellCallBack

clcy1243 avatar Jun 18 '20 03:06 clcy1243

We support Java file merge in the Eclipse plugin. The merge makes use of Eclipse's Java parser and AST walker - which is a very difficult thing to implement.

I'm assuming it is possible to do it outside of Eclipse with something like https://javaparser.org/ and I have it on my list of things to investigate in the future.

jeffgbutler avatar Jun 19 '20 10:06 jeffgbutler

I don't understand exactly how you want to merge, maybe the following pattern could solve the problem without merging: https://github.com/jsonshen/MyBatisX/blob/master/examples/src/main/java/org/shenjia/mybatis/examples/dao/MultiColPkDao.java MultiColPkDao.java file is manually maintained by the user will not be overwritten, MultiColPkMapper.java is completely auto-generated code.

octoape avatar Dec 17 '23 05:12 octoape