String类型转换成List

String=1,2,3 如何转换成List 用正则最好
2025-01-01 04:56:08
推荐回答(1个)
回答1:

public UserInfo queryNumber(String name) {
// TODO Auto-generated method stub

String sql="select user-info.*,buyer-in.*from user-info a left outer join buyer-in b on user-info.buyerid=buyer-in.buyerid where a.Aname=?";

SQLQuery query = sessionFactory.getCurrentSession().createSQLQuery(sql);

query.setString(0, name);
query.addEntity(UserInfo.class);
List list=query.list();

list=query.list();

return list;
我想把查询结果返回到个结果集,现在报错不同类型无法转换cannotmatch
求修改