13 个解决方案
#1
实体类集合用的HashSet,因为User类有多个实体类,用ArrayList报错cannot simultaneously fetch multiple bags
#2
不会吧。我们一直就是这样做的啊,楼主的ArrayCollection里面存储的对象,有没有跟后台的model映射?
#3
你好,映射了的,你们都是怎么处理的啊?
#4
我们就是这样做的啊,
public class UserVO
{
public function UserVO()
{
}
private var _userId:String;
private var _commonName:String;
private var _lastName:String;
private var _email:String;
private var _username:String;
private var _password:String;
private var _userRealName:String;// 用户姓名
private var _roles:ArrayCollection = new ArrayCollection();//集合
}
这是我们的一个VO类,里面也有一个集合,_roles就是角色嘛,只要角色的vo跟后台的model映射了。应该没问题啊,我们操作的时候 就直接传一个userVO到后台就可以了
#5
package cn.edu.hyit.oa.vo
{
import mx.collections.ArrayCollection;
[Bindable]
[RemoteClass(alias="cn.edu.hyit.oa.model.User")]
public class UserVo
{
public function UserVo()
{
}
public var id:int;
public var did:DepartmentVo;
public var ismanager:int;
public var name:String;
public var password:String;
public var age:int;
public var gender:String;
public var state:int;
public var tel:String;
public var qq:String;
public var email:String;
public var address:String;
public var articles:ArrayCollection;
public var bulletins:ArrayCollection;
public var officeDocs:ArrayCollection;
public var schedules:ArrayCollection;
public var signs:ArrayCollection;
public var emails:ArrayCollection;
}
}
我也是啊,后台是:
@Entity
public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String address;
private int age;
private Set<Article> articles = new HashSet<Article>();
private Set<Bulletin> bulletins = new HashSet<Bulletin>();
private Department did;
private String email;
private Set<Email> emails = new HashSet<Email>();
private String gender;
private int id;
private int ismanager;
private String name;
private Set<OfficeDoc> officeDocs = new HashSet<OfficeDoc>();
private String password;
private String qq;
private Set<Schedule> schedules = new HashSet<Schedule>();
private Set<Sign> signs = new HashSet<Sign>();
private int state;
private String tel;
有相应的集合,比如我要删除一个User,同时把他里面的集合删除,总是不是行啊,flex端的ArrayCollection,到后台不能自动转换为HashSet,而是ASObject对象了
方便加QQ聊么,我qq 1072907909,这个问题困扰了很久了
#6
用flex 的 字典类型试试可以不!
#7
呃,没听过啊,怎么用?
#8
Dictionary 类 类似java 的key与value键值对应可以试试
java后台不要直接用hashSet来接数据!这样的话好像不可以可以!使用ArrayList来接数据然后转为你需要的HashSet数据类型
#9
这东西研究起来还真麻烦
#10
同感呀
#11
可能是flex端,没有编译这个类
#12
可能是flex端,没有编译这个类
#13
应该是UserVO和JAVA中User 没有映射成功!
#1
实体类集合用的HashSet,因为User类有多个实体类,用ArrayList报错cannot simultaneously fetch multiple bags
#2
不会吧。我们一直就是这样做的啊,楼主的ArrayCollection里面存储的对象,有没有跟后台的model映射?
#3
你好,映射了的,你们都是怎么处理的啊?
#4
我们就是这样做的啊,
public class UserVO
{
public function UserVO()
{
}
private var _userId:String;
private var _commonName:String;
private var _lastName:String;
private var _email:String;
private var _username:String;
private var _password:String;
private var _userRealName:String;// 用户姓名
private var _roles:ArrayCollection = new ArrayCollection();//集合
}
这是我们的一个VO类,里面也有一个集合,_roles就是角色嘛,只要角色的vo跟后台的model映射了。应该没问题啊,我们操作的时候 就直接传一个userVO到后台就可以了
#5
package cn.edu.hyit.oa.vo
{
import mx.collections.ArrayCollection;
[Bindable]
[RemoteClass(alias="cn.edu.hyit.oa.model.User")]
public class UserVo
{
public function UserVo()
{
}
public var id:int;
public var did:DepartmentVo;
public var ismanager:int;
public var name:String;
public var password:String;
public var age:int;
public var gender:String;
public var state:int;
public var tel:String;
public var qq:String;
public var email:String;
public var address:String;
public var articles:ArrayCollection;
public var bulletins:ArrayCollection;
public var officeDocs:ArrayCollection;
public var schedules:ArrayCollection;
public var signs:ArrayCollection;
public var emails:ArrayCollection;
}
}
我也是啊,后台是:
@Entity
public class User implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String address;
private int age;
private Set<Article> articles = new HashSet<Article>();
private Set<Bulletin> bulletins = new HashSet<Bulletin>();
private Department did;
private String email;
private Set<Email> emails = new HashSet<Email>();
private String gender;
private int id;
private int ismanager;
private String name;
private Set<OfficeDoc> officeDocs = new HashSet<OfficeDoc>();
private String password;
private String qq;
private Set<Schedule> schedules = new HashSet<Schedule>();
private Set<Sign> signs = new HashSet<Sign>();
private int state;
private String tel;
有相应的集合,比如我要删除一个User,同时把他里面的集合删除,总是不是行啊,flex端的ArrayCollection,到后台不能自动转换为HashSet,而是ASObject对象了
方便加QQ聊么,我qq 1072907909,这个问题困扰了很久了
#6
用flex 的 字典类型试试可以不!
#7
呃,没听过啊,怎么用?
#8
Dictionary 类 类似java 的key与value键值对应可以试试
java后台不要直接用hashSet来接数据!这样的话好像不可以可以!使用ArrayList来接数据然后转为你需要的HashSet数据类型
#9
这东西研究起来还真麻烦
#10
同感呀
#11
可能是flex端,没有编译这个类
#12
可能是flex端,没有编译这个类
#13
应该是UserVO和JAVA中User 没有映射成功!