Помогите разобраться с тестированием Ibatis 3. Вот код сущности: | Код | package ru.cct.poker.common.model;
/** * Buyin_ext entity. @author Serge */ public class BuyinExt implements java.io.Serializable { private Integer tableTmplUid; private Short type; private Integer uid; private Short value;
public BuyinExt() {} public Integer getUid() { return this.uid; }
public void setUid(Integer uid) { this.uid = uid; }
public Integer getTableTmplUid() { return this.tableTmplUid; }
public void setTableTmplUid(Integer tableTmplUid) { this.tableTmplUid = tableTmplUid; }
public Short getType() { return this.type; }
public void setType(Short type) { this.type = type; }
public Short getValue() { return this.value; }
public void setValue(Short value) { this.value = value; } }
|
и вот еще код маппера: | Код | package ru.cct.poker.server.pg.core.data;
import java.util.Set; import ru.cct.poker.common.model.BuyinExt; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update;
public interface BuyinExtMapper { @Select({"Select uid, table_Tmpl_Uid, type from buyin_ext where uid = #{uid} "}) BuyinExt selectBuyinExt(final int uid);
@Select("Select #uid(uid:INTEGER), #table_tmpl_uid(Table_tmpl_uid:INTEGER)," + " #type(type:INTEGER), #value(value:TINYINT) from buyin_ext ") Set<BuyinExt> selectAllByuinExts();
@Insert({"insert into buyin_ext(uid, table_Tmpl_Uid, type, value)" + " values (#{uid}, #{tableTmplUid}, #{type}, #{value})"}) void insertBuyinExt(final BuyinExt arg);
@Update ({"Update BuyinExt Set", "uid = @uid(INTEGER:IN)," + "table_tmpl_uid = @tableTmplUid(INTEGER:IN), type = @type(TINYINT:IN), value = @value(TINYINT:IN)" }) void updateBuyinExt(BuyinExt buyinext);
@Delete("delete from buyin_ext") void deleteAll();
@Delete("delete from buyin_ext where uid = @uid") void deleteBuyinExt( int uid); }
|
При генерации JUnit-теста этот интерфейс реализовывается, правда, возвращает он NULL'и. Не совсем понимаю, как именно маппинг с аннотациями должен работать, и как его использовать. Использовал при его написании вот этот ресурс http://opensource.atlassian.com/confluence...teboard-Caching
|