Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a code assist on Groovy language #56

Open
kazuki43zoo opened this issue Jul 14, 2016 · 1 comment
Open

Support a code assist on Groovy language #56

kazuki43zoo opened this issue Jul 14, 2016 · 1 comment

Comments

@kazuki43zoo
Copy link
Member

I hope to support a code assist on Groovy language!!
I will prefer to create a mapper interface using groovy language. Groovy language is more readable on annotation.

e.g.)

package com.example.mapper

import com.example.domain.Todo
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Options
import org.apache.ibatis.annotations.Select

@Mapper
interface TodoMapper {

    @Insert('''
        INSERT INTO todo
            (title, details, finished)
        VALUES
            (#{title}, #{details}, #{finished})
    ''')
    @Options(useGeneratedKeys = true)
    void insert(Todo todo);

    @Select('''
        SELECT
            id, title, details, finished
        FROM
            todo
        WHERE
            id = #{id}
    ''')
    Todo select(int id);

}

For Demo application, please see here.

What do you think ?

@harawata
Copy link
Member

It seemed to be possible because groovy-eclipse plugin provides an extension point for this enhancement.
But it turned out that there is no annotation information attached to the Java model provided by the plugin.

There is even a test case ensuring this behavior.
The comment of the test case reads:

Only marker annotations or SingleMember annotations whose member is a class literal are copied over.

Does anyone know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants