|
Hi, I am Korean User for MyBatis Generator. I have a difficult for generation using MBG in eclipe. Using contextGenerateAdditionalJavaFiles in PluginAdapter, there is one error message "NullPointerException". But after deleting generated files, generation was successful. The source code are here.
//================================================================ package auri.common.util; import java.util.*; import org.mybatis.generator.api.*; import org.mybatis.generator.api.dom.java.*; public class MyBatisPluginForAuriTest extends PluginAdapter { @Override public boolean validate(List<String> arg0) { return true; }
public List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) { ArrayList<GeneratedJavaFile> retn = new ArrayList<GeneratedJavaFile>(); TopLevelClass cls = new TopLevelClass(introspectedTable.getBaseRecordType() + "Factory");
String targetProject = this.getContext().getJavaClientGeneratorConfiguration().getTargetProject(); GeneratedJavaFile javaFile = new GeneratedJavaFile(cls, targetProject); retn.add(javaFile);
return retn; } } //================================================================ Thanks. |
|
Open the eclipse error log (window-->show view->Error Log) and you
should see a full stack trace for the error. Post the stack trace here and maybe we can help. Jeff Butler On Mon, Mar 19, 2012 at 12:15 AM, jeremyoh <[hidden email]> wrote: > Hi, I am Korean User for MyBatis Generator. > > I have a difficult for generation using MBG in eclipe. > > Using contextGenerateAdditionalJavaFiles in PluginAdapter, there is one > error message "NullPointerException". But after deleting generated files, > generation was successful. > > > > The source code are here. > > > > //================================================================ > > package auri.common.util; > > > import java.util.*; > > import org.mybatis.generator.api.*; > > import org.mybatis.generator.api.dom.java.*; > > > public class MyBatisPluginForAuriTest extends PluginAdapter { > > > @Override > > public boolean validate(List<String> arg0) { > > return true; > > } > > public List<GeneratedJavaFile> > contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) > > { > > ArrayList<GeneratedJavaFile> retn = new ArrayList<GeneratedJavaFile>(); > > TopLevelClass cls = new TopLevelClass(introspectedTable.getBaseRecordType() > + "Factory"); > > String targetProject = > this.getContext().getJavaClientGeneratorConfiguration().getTargetProject(); > > GeneratedJavaFile javaFile = new GeneratedJavaFile(cls, targetProject); > > retn.add(javaFile); > > return retn; > > } > > } > > //================================================================ > > > > Thanks. |
|
In reply to this post by jeremyoh
after reboot, the problem has solved.
There is none of eclipse error. Thanks for your help. |
| Powered by Nabble | Edit this page |
