javatype与oftype的区别

JavaType和ofType都是用来指定对象类型的,但是JavaType是用来指定pojo中对象属性的类型,而ofType指定的是映射到list集合属性中泛型的类型

xml文件




    
        
        
        
        
            
            
        
      
        
            
            
            
            
        
        
        
            
            
            
        

    

    

实体类:

package com.fpy.rbac.pojo;

import java.util.ArrayList;
import java.util.List;

public class Users {
    private String username;
    private String userpwd;
    private Roles roles;
    private List menus = new ArrayList();
    private List funs = new ArrayList<>();
    public List getFuns() {
        return funs;
    }
    public void setFuns(List funs) {
        this.funs = funs;
    }
    public List getMenus() {
        return menus;
    }
    public void setMenus(List menus) {
        this.menus = menus;
    }
    public Roles getRoles() {
        return roles;
    }
    public void setRoles(Roles roles) {
        this.roles = roles;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getUserpwd() {
        return userpwd;
    }
    public void setUserpwd(String userpwd) {
        this.userpwd = userpwd;
    }

    @Override
    public String toString() {
        return "Users{" +
                "username='" + username + '\'' +
                ", userpwd='" + userpwd + '\'' +
                ", roles=" + roles +
                ", menus=" + menus +
                ", funs=" + funs +
                '}';
    }
}

 

你可能感兴趣的:(ssm)