首页 新闻 搜索 专区 学院

新手求助——不受支持的返回类型

0
悬赏园豆:100 [已解决问题] 解决于 2015-08-27 15:22
//实体类:
public class Result implements Serializable{
    
    private static final long serialVersionUID = 1L;
    private String status;
    private String msg;
    private Object data;
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
    public Object getData() {
        return data;
    }
    public void setData(Object data) {
        this.data = data;
    }
    @Override
    public String toString() {
        return "Result [status=" + status + ", msg=" + msg + ", data=" + data
                + "]";
    }

public class WarehouseNode {
    private String warehouse_node_id;
    private String warehouse_node_place;
    private double warehouse_node_Xcoordinates;
    private double warehouse_node_Ycoordinates;
    public String getWarehouse_node_id() {
        return warehouse_node_id;
    }
//省略get  set方法不写上来
//这是DAO里面的
public Result addWarehouseNode(WarehouseNode warehouseNode);

//然后在service里面调用方法
public Result addWarehouseNode(WarehouseNode warehouseNode) {
        Result result=new Result();
        List<WarehouseNode> list=warehouseDao.findeWarehouseNodeByPlace();
        
        //判断id是否重复
        if(list.get(1).equals(warehouseNode.getWarehouse_node_id())){
            result.setStatus("1");
            result.setMsg("这个仓库已被占用");
            return result;
        }
                
        warehouseDao.addWarehouseNode(warehouseNode);
        result.setStatus("0");
        result.setMsg("添加成功");
           return result;
        
    }


//这是Controller里面的

public Result addByWarehouseNode(WarehouseNode warehouseNode){
        Result result= warehouseImpl.addWarehouseNode(warehouseNode);    
        
            return result;
 
    }

//运行的时候报这个错
/*Mapper method 'com.ninelue.dao.WarehouseNodeDAO.addWarehouseNode' has an unsupported return type: class com.ninelue.entity.Result*/

 

 


 


初学者2号的主页 初学者2号 | 初学一级 | 园豆:22
提问于:2015-08-27 09:50
< >
分享
最佳答案
1

//DAO里面改成

public Result addWarehouseNode(WarehouseNode warehouseNode);

初学者2号 | 初学一级 |园豆:22 | 2015-08-27 15:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册