日期:2014-05-17  浏览次数:20717 次

谁帮我解释下这个类什么意思啊 关于springmvc 和mybatis的
* @author geloin 
 * @date 2012-5-5 上午10:26:34 
 */  
package com.geloin.spring.mapper;  
  
import java.util.List;  
  
import org.apache.ibatis.annotations.Param;  
import org.apache.ibatis.annotations.Result;  
import org.apache.ibatis.annotations.Results;  
import org.apache.ibatis.annotations.Select;  
import org.springframework.stereotype.Repository;  
  
import com.geloin.spring.entity.Menu;  
  
/** 
 *  
 * @author geloin 
 * @date 2012-5-5 上午10:26:34 
 */  
@Repository(value = "menuMapper")  
public interface MenuMapper {  
  
    @Select(value = "${sql}")  
    @Results(value = { @Result(id = true, property = "id", column = "id"),  
            @Result(property = "parentId", column = "c_parent_id"),  
            @Result(property = "url", column = "c_url"),  
            @Result(property = "isShowLeft", column = "c_is_show_left"),  
            @Result(property = "name", column = "c_name") })  
    List<Menu> operateReturnBeans(@Param(value = "sql") String sql);  
}

------解决方案--------------------

------解决方案--------------------
引用:
column = "c_parent_id"),  
这个参数有用吗,感觉没啥用呢
当然有用,通过JPA实现数据库和实体的映射关联,prototype是实体属性,column是表的字段,二者之间需要建立联系。