首页 > 其他 > 详细

No suitable constructor found for type [simple type, class com.beiyanght.dxhbm.vehiclemanagement.business.Student.dto.StudentCondition]: can not insta

时间:2014-03-20 18:17:24      阅读:498      评论:0      收藏:0      [点我收藏+]

package com.beiyanght.dxhbm.vehiclemanagement.business.Student.dto;

import java.io.IOException;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.wakeframework.utils.JsonHelper;


/**
 * @功能名 Student - 查询条件
 * @类描述 数据传输对象
 * @author
 * @Date 2014-3-20
 */
public class StudentCondition {

    /**
     * 学生姓名
     */
    private String name ;
    /**
     * 学号
     */
    private String no ;
    /**
     * 性别
     */
    private String sex ;
    /**
     * 年龄
     */
    private int age ;
    /*-----------------构造方法(@QueryParam 注入需要) -------------------------------*/
    public StudentCondition (String json){
        
    }
   

    public static StudentCondition valueOf(String json) throws JsonParseException, JsonMappingException, IOException {
        StudentCondition condition = JsonHelper.getBean(json, StudentCondition.class) ;
        return condition ;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

出现该异常:是因为该类中缺少一个缺省构造

需要添加缺省构造函数

public StudentCondition() {
        super();
        // TODO Auto-generated constructor stub
    }

不然其他类中不可定义该类对象

No suitable constructor found for type [simple type, class com.beiyanght.dxhbm.vehiclemanagement.business.Student.dto.StudentCondition]: can not insta,布布扣,bubuko.com

No suitable constructor found for type [simple type, class com.beiyanght.dxhbm.vehiclemanagement.business.Student.dto.StudentCondition]: can not insta

原文:http://www.cnblogs.com/myitmylife/p/3614133.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!