tanqidong1992 / mybatiseditor

Automatically exported from code.google.com/p/mybatiseditor
0 stars 0 forks source link

Content Assist #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It's a welcome site to see someone creating tooling for Ibatis/Mybatis. 

I am wondering if it will be possible to expand the content assist to include 
parameter resolution and resultmap resolution: 

<resultMap id="findMemberSummaryResults"
  class="com.landacorp.common.model.member.MemberSummary"
  groupBy="internalId">

  <result property="|" column="MEM_UID" />
</resultMap>

If the cursor is at the position denoted by the pipe sign (|) above, hitting 
control space would result in a list of properties defined on 
"com.landacorp.common.model.member.MemberSummary"

Something similar for SQL that has parameters defined would also be useful: 

<select id="someSelect" 
parameterClass="com.landacorp.common.model.member.Member" 
resultMap="memberAlertHistoryMap">

SELECT * FROM MLH_MEM_ALERT_HISTORY JOIN MEM_MEMBER ON MLH_MEM_UID = MEM_UID
WHERE TRUNC(SYSDATE) BETWEEN MLH_DATE_BEGIN and MLH_DATE_END
<isNotNull prepend="AND" property="|">
  MLH_MEM_UID = #internalId#
</isNotNull>
.
.
</select>

Thanks for you work on this.

Original issue reported on code.google.com by snowto...@gmail.com on 2 Apr 2012 at 7:34

GoogleCodeExporter commented 8 years ago
Good idea! MyBatisEditor uses the default XML Editor from Eclipse Web Tools, so 
it would need to fit in there. I will investigate the possibilities to extend 
content assist on the Eclipse XML Editor. 

Original comment by peerkehe...@gmail.com on 8 Apr 2012 at 12:25

GoogleCodeExporter commented 8 years ago
Finally managed to take time to work out the content assist proposals in XML 
editor (and co-exist happily with popular XML editor add-ons like M2E). I have 
pushed some support for completing on id references, resultMaps. Will try on 
the "property" Java resolves. These are a bit more tricky, but it should be 
doable.

Original comment by peerkehe...@gmail.com on 4 Jul 2012 at 2:34

GoogleCodeExporter commented 8 years ago
The new 1.1.0 version contains the completion enhancements!

I skipped "isNotNull" for now, but a lot of code completions should now work in 
resultMap. isNotNull requires some more work because, it's different from 
resultmap (getters vs setters) and less clear where the type information is 
(can be used in includes as well).

Other things, like completion on Java types, or recognizing type aliases, seem 
useful too. There is some basic infrastructure in the code, but is a lot more 
work to make this behave and feel sane, and next weeks will be busy for me, so 
I am skipping this for now. Please, let me know what you think!

Original comment by peerkehe...@gmail.com on 6 Jul 2012 at 8:02

GoogleCodeExporter commented 8 years ago
Awesome, I will give it a try. Thanks for your work on this.

Original comment by snowto...@gmail.com on 6 Jul 2012 at 9:03

GoogleCodeExporter commented 8 years ago
my eclipse version 4.3 don't have Navigate from a Java Mapper interface to the 
corresponding XML.
can you tell me how to do

Original comment by qrb.jue...@gmail.com on 14 Jan 2014 at 9:08