select t.org_id as key, --key值 t.org_name as title, --标题 t.has_sub as folder, --是否显示文件夹 t.has_sub as lazy, --是否懒加载 t.orderby --排序 from (select d.*, case when s.parent_org_id ='00000000000000000000000000000000' then 0 else 1 end as has_sub from sec_or
MyBatis关联查询和懒加载错误 今天在写项目时遇到了个BUG.先说一下背景,前端请求更新生产订单状态,后端从前端接收到生产订单ID进行查询,然后就有问题了. 先看控制台报错: org.apache.ibatis.executor.ExecutorException: Statement returned more than one row, where no more than one was expected. 很明显,预期查出一条记录的结果查出了多条记录.因为在实现 service 层代
通过昨天对EF贪婪加载和延迟加载的学习,不难发现,延迟加载还是很好用的,但是问题也就来了,有的时候我们只需要加载一个实体,不需要和他相关的外部实体,这时候我们来看看EF延迟加载时怎么作用的吧 打开profiler 在Main函数入口处写一个查询,在Console.Read();处打一个断点 static void Main(string[] args) { var context = new EFDbContext(); var user = context.Users.FirstOrDefau