今天配置实体类注解时,出现以下错误: Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: ss_user, for columns: [org.hibernate.mapping.Column(role_list)] 解决方案:注解要么写在字段上,要么写在getXX上,千万千万不能混合使用,否则会报这个错误!
一.实体类转换成XML 将实体类转换成XML需要使用XmlSerializer类的Serialize方法,将实体类序列化 public static string XmlSerialize<T>(T obj) { using (StringWriter sw = new StringWriter()) { Type t= obj.GetType(); XmlSerializer serializer = new XmlSerializer(obj.GetType()); serializer.
官方项目下载: http://automapper.codeplex.com/ 博文 http://www.iteye.com/blogs/tag/AutoMapper 图解: 第一步:创建映射Map:AutoMapperBootStrapper.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using Agathas.Storefront.Infrastructu
上一篇文章中写到在.net中实体类跟json格式的相互转换,今天在做具体转换时候,发现之前版本的jsonhelp对于日期类型的转换不全面.之前版本的jsonhelp中从实体类转换成json格式时候,将日期格式转成了时间戳的形式.在这里对这个jsonhelp做出了更新.以解决转换日期类型字段的问题.代码如下: JsonHelp.cs using System; using System.Collections.Generic; using System.Linq; using System.Tex