MyBatipse - Eclipse plugin for MyBatis

290 views
Skip to first unread message

Iwao AVE!

unread,
Feb 5, 2014, 11:00:13 PM2/5/14
to mybatis-user
Hi All,

Just released a new Eclipse plugin for MyBatis.
https://github.com/harawata/mybatipse

Auto-completion and validation are the two main features.
If auto-completion does not work in newly created file, try reopening
the editor after adding the DOCTYPE.

A note to contributors:
There are some intentional errors and type alias conflicts in the test
cases of mybatis-3 project, so you may want to disable MyBatipse
validation in the project properties setting.
Also note that there is a Mac OS X specific nasty bug related to this
operation in Eclipse 4.3.1.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412826

Enjoy!
Iwao

Eduardo Macarron

unread,
Feb 6, 2014, 1:45:27 PM2/6/14
to mybati...@googlegroups.com
I am installing it right now. 

Thank you very much Iwao!!




2014-02-06 Iwao AVE! <hara...@gmail.com>:
Iwao

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Iwao AVE!

unread,
Feb 6, 2014, 10:38:45 PM2/6/14
to mybatis-user
Thank you, Eduardo.
You always keep me motivated in various ways :-)

2014-02-07 Eduardo Macarron <eduardo....@gmail.com>:

Paul Krause

unread,
Feb 16, 2014, 1:16:27 PM2/16/14
to mybati...@googlegroups.com
Nice.  Right after installing I found two mapping errors that had gone undetected for months.

Keep up the good work.

Iwao AVE!

unread,
Feb 16, 2014, 9:49:36 PM2/16/14
to mybatis-user
Thank you for the feedback, Paul!
It is difficult to validate without false positives, but I will do my best.

FYI, a small update is planned within a week or so.

Regards,
Iwao

Paul Krause

unread,
May 2, 2014, 5:08:46 PM5/2/14
to mybati...@googlegroups.com
I just updated to MyBatipse 1.0.3.201405010033, and now I realize that the issue had nothing to do with associations after all.
The problem is that MyBaptise reports non-public inherited fields as missing.
Changing the visibility of the fields from private to public made the error messages go away.

But I don't want to check in code that looks like this.  Do you think you can find a fix?

Iwao AVE!

unread,
May 3, 2014, 10:26:29 AM5/3/14
to mybatis-user
Thank you for the info, Paul!
I think I can fix it in the next version.

Regards,
Iwao
> --
> You received this message because you are subscribed to the Google Groups
> "mybatis-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mybatis-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Mukarram

unread,
Sep 11, 2014, 1:27:28 AM9/11/14
to mybati...@googlegroups.com
Hello Iwao 

I see that 1.0.6 version has been released, however, I still see the issue that Paul has pointed out. I couldn't find a bug/feature request for this issue on the github page and hence was not sure if this was targeted and fixed in this version. 

Thanks in advance.

Iwao AVE!

unread,
Sep 11, 2014, 3:18:10 AM9/11/14
to mybatis-user
Hi Mukarram,

Here's the ticket which was fixed in 1.0.4.
https://github.com/harawata/mybatipse/issues/5

I can verify the fix with the following java class and resultMap.

public class Person {
private Integer id;
private String name;
}

<resultMap type="private_result.Person" id="PersonResult">
<id property="id" column="id" />
<result property="name" column="name" />
</resultMap>

If you could post the relevant part of your mapper/code, I'll look into it.

Thank you!
Iwao

Mukarram

unread,
Sep 11, 2014, 8:27:24 PM9/11/14
to mybati...@googlegroups.com
Hi Iwao,

I guess the problem is with the inherited properties that are private in the parent but are accessible via the public getter/setter methods. Concretely, with a contrived example, if the Person class inherited from a parent class, say Animal, which had a private field named "diet" (bear with me :)) which has public getter setters, then setting diet property in the resultMap XML for Person class is throwing a Mybatipse validation error saying diet property is not available on Person, though it is accessible via the public getter/setters and Mybatis is able to use it as such.

public class Animal {
private String diet;
public String getDiet() { return diet;}
public void setDiet(String diet) { this.diet = diet;}
}

public class Person extends Animal { 

  private Integer id; 
  private String name; 


<resultMap type="private_result.Person" id="PersonResult"> 
  <id property="id" column="id" /> 
  <result property="name" column="name" /> 
  <result property="diet" column="diet" />  <!-- Error here in Mybatipse -->
</resultMap> 

Let me know if this makes sense.

Thanks!
Mukarram

Iwao AVE!

unread,
Sep 11, 2014, 10:25:39 PM9/11/14
to mybatis-user
Hi Mukarram,

Your explanation makes sense totally, but I couldn't reproduce it...
I have added the Animal class to my test and the result element for
'diet' passed validation without an error (even without the
setter/getter).

Could you try that example on a clean installation of Eclipse?

Thank you!
Iwao

Mukarram

unread,
Sep 12, 2014, 2:00:22 AM9/12/14
to mybati...@googlegroups.com
Hi Iwao,

I tried with a clean eclipse install, but am still seeing the issue - which mostly points to some other misconfiguration that I might have on my end. Can you please point me to a test case in the mybatipse source code that I can plugin my class structure and check where it might be going wrong.

Thanks again!

Iwao AVE!

unread,
Sep 12, 2014, 1:50:34 PM9/12/14
to mybatis-user
There is no test case in that project XD
All I have is a few projects that contain files like the Animal.java, etc.

If you have installed PDE, you can debug MyBatipse by opening
plugin.xml and clicking 'Launch an Eclipse application in Debug mode'
(theoretically).

I have created a new ticket, so please post your findings there.
https://github.com/harawata/mybatipse/issues/22

Thank you,
Iwao
Reply all
Reply to author
Forward
0 new messages