如题:
我用访问一个webservice,客户端出入一个xml对象集合,
解析成一个本地java一个集合对象列表
对象ID是自动生成的;
调用this.getHibernateTemplate().saveOrUpdateAll(entities); 方法,却发现entities内的对象中的ID都是一样的!
调
public static void main(String[] args) throws MalformedURLException, Exception {
String bizLog = 业务数据 省略了.
Object[] o = new Object[]{bizLog};
Client c = new Client(new URL("http://192.168.72.41:8080/common/service/LogInfo?wsdl"));
Object[] results = c.invoke("addLogs",o);
}
借口代码:
List bizLogList = ParserXML.parseEntityLog(xmlstr, menuName, BizLog.class);
return bizLogService.saveAll(bizLogList); 调试的时候可以查看到数据已经转换成功!
ID生成方式
@Id
@GeneratedValue(strategy=GenerationType.AUTO )
@Column(name="FID")