总的来看Spring+Hibernate与JPA很相似,它们都是基于pojo的持久化。
Hibernate Session和JPA Entity Manager基本上等价,但是要记住他们的两个重要区别。
Hibernate session是一个实体缓存也是一个ORM引擎的接口。
而JPA中这两个概念是分开的。Persistence context作为缓存而...
分类:
编程语言 时间:
2014-07-22 23:03:55
阅读次数:
379
IntroductionRecently I was playing around with
Entity Framework (EF) and evaluating it for some projects. I had a very hard
time figuring out how to a...
分类:
数据库 时间:
2014-05-08 13:05:33
阅读次数:
678
IntroductionThis article is part of the ongoing
series I’ve been writing recently, but can be read as a standalone article. I’m
going to do a better j...
分类:
其他好文 时间:
2014-05-08 13:01:13
阅读次数:
599
这是微软官方教程Getting Started with Entity Framework 6
Code First using MVC 5 系列的翻译,这里是第六篇:为ASP.NET MVC应用程序创建更复杂的数据模型原文:Creating a More
Complex Data Model fo...
分类:
Web程序 时间:
2014-05-08 12:03:22
阅读次数:
581
Entity framework在验证未通过的时候默认不会抛出详细异常,这给我们debug带来很大的困难,不过我们可以手动捕获,见代码:
private int Update(Employee entity)
{
string error = string.Empty;
using (NorthwindEntities ctx = ...
分类:
其他好文 时间:
2014-05-07 21:50:21
阅读次数:
302
solution1.Tick the primary key 1.right click on
the Id of the entity in dataset schema. 2.Edit Key 3.Tick the Primary Key
分类:
其他好文 时间:
2014-05-07 19:18:56
阅读次数:
362
首先看一下什么是懒加载:
所谓懒加载(lazy)就是延时加载,延迟加载。
什么时候用懒加载呢,我只能回答要用懒加载的时候就用懒加载。
至于为什么要用懒加载呢,就是当我们要访问的数据量过大时,明显用缓存不太合适,
因为内存容量有限 ,为了减少并发量,减少系统资源的消耗,
我们让数据在需要的时候才进行加载,这时我们就用到了懒加载。
比如部门ENTITY和员工EN...
分类:
其他好文 时间:
2014-05-07 05:39:35
阅读次数:
556
package com.rgy.entity;
import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Bo...
分类:
编程语言 时间:
2014-05-07 03:23:31
阅读次数:
433
这是微软官方SignalR 2.0教程Getting Started with Entity
Framework 6 Code First using MVC 5 系列的翻译,这里是第五篇:MVC程序中实体框架的Code
First迁移和部署原文:Code First Migrations and ...
分类:
Web程序 时间:
2014-05-06 13:16:59
阅读次数:
511
Sql Server Compact 4.0相比3.5版本增强了很多,支持Entity
Framework 4.1,对于轻量级应用来讲,使用Sql Server Compact 4.0是个很好的选择,而且部署相当方便,不需要Sql Server
Compact 4.0的安装包,仅需要发布相关的dll...
分类:
数据库 时间:
2014-05-02 19:45:32
阅读次数:
517