Skip to content

Support a code assist on Groovy language #56

Open
@kazuki43zoo

Description

@kazuki43zoo

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions