package org.itevents.mapper;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.itevents.model.Currency;

/**
 * Created by vaa25 on 17.07.2015.
 */
public interface CurrencyMapper {

    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
    })
    @Select("SELECT id, name FROM currencies WHERE id = #{id}")
    Currency getCurrency(int id);
}

@@ -64,105 +64,9 @@
 ons.
-Result;%0Aimport org.apache.ibatis.annotations.Results;%0Aimport org.apache.ibatis.annotations.Select
+*
 ;%0Aim
@@ -408,10 +408,337 @@
 nt id);%0A
+%0A    @Insert(%22INSERT INTO currencies(id, name) VALUES(#%7Bid%7D, #%7Bname%7D)%22)%0A    Currency addCurrency(Currency currency);%0A%0A    @Update(%22UPDATE currencies SET id=#%7Bid%7D, name=#%7Bname%7D WHERE id =#%7Bid%7D%22)%0A    void updateCurrency(Currency currency);%0A%0A    @Delete(%22DELETE FROM currencies WHERE id =#%7Bid%7D%22)%0A    void removeCurrency(int id);%0A%0A
 %7D%0A

add CRUD to CurrencyMapper