Quantcast

about Error for MBG Additional Java Files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

about Error for MBG Additional Java Files

jeremyoh

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.


file2.JPG (154K) Download Attachment
file1.JPG (189K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: about Error for MBG Additional Java Files

Jeff Butler
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: about Error for MBG Additional Java Files

jeremyoh
In reply to this post by jeremyoh
after reboot, the problem has solved.
There is none of eclipse error.

Thanks for your help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: about Error for MBG Additional Java Files

jeremyoh
In reply to this post by Jeff Butler

after reboot, the problem has solved.

There is none of eclipse error.

Thanks for your help.

Loading...