ORM
共 13 篇文章
MyBatis工作流程
Reference https://www.cnblogs.com/wuzhenzhao/p/11103017.html https://blog.csdn.net/u010890358/article/details/80665753
2019-08-12 10:46 · ORM
MyBatis一级缓存和二级缓存(转)
作者:little飞 出处: http://www.cnblogs.com/little-fly/ 欢迎转载 一级缓存 MyBatis会在表示会话的SqlSession对象中建立一个简单的缓存,将每次查询到的结果结果缓存起来,当下次查询的时候,如果判断先前有个完全一样的查询,会直接从缓存中直接将结果取出,返回给用户,不需要再进行一次数据库查询了。 MyBatis会在一次会话的表示 —— 一个SqlSession对象中创建一个本地缓存(local cache),对于每一次查询,都会尝试根据查询的条件去本地缓存中查找是否在缓存中,如果在缓存中,就直接从缓存中取出,然后返回给用户;否则,从数据库读…
2017-08-31 20:26 · ORM
Spring MyBatis CRUD
原创转载请注明出处: http://agilestyle.iteye.com/blog/2377160 Project Directory Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVers…
2017-05-31 22:05 · ORM
Hibernate常见术语、操作、区别
原创转载请注明出处: http://agilestyle.iteye.com/blog/2359961 Hibernate核心接口 Configuration SessionFactory Session Query Criteria Transaction Hibernate工作原理 配置Configuration对象,读取并解析配置文件 读取并解析映射信息,创建SessionFactory 创建session对象 开启事务Transaction 完成CRUD持久化操作 提交事务 关闭session Hibernate关系映射 @ManyToOne(fetch默认FetchType是eag…
2017-03-02 22:08 · ORM
Hibernate HQL, SQL查询及抓取策略
1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.fool.hibernate</groupId> <a…
2013-04-10 09:53 · ORM
MyBatis CRUD Operations
1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.fool.mybatis</groupId> <art…
2013-03-27 16:48 · ORM
Spring Hibernate CRUD
1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.fool.springjdbc</groupId> <…
Hibernate 3和4的HibernateUtil
Hibernate 3 1.Maven Dependency <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.fool.hibernate<…
2013-02-16 16:19 · ORM
Hibernate getCurrentSession() vs openSession()
1、getCurrentSession()与openSession()的区别 * 采用getCurrentSession()创建的session会绑定到当前线程中,而采用openSession() 创建的session则不会 * 采用getCurrentSession()创建的session在commit或rollback时会自动关闭,而采用openSession()创建的session必须手动关闭 2、使用getCurrentSession()需要在hibernate.cfg.xml文件中加入如下配置: * 如果使用的是本地事务(jdbc事务) <property name="hibern…
2012-12-21 12:30 · ORM
Hibernate Many to Many Annotation Example
1.schema.sql alter table student_course drop foreign key FKB0A3729FA6819B7; alter table student_course drop foreign key FKB0A3729FA135F25D; drop table if exists course; drop table if exists student; drop table if exists student_course; create table course (cid integer not null auto_increment, name …
2012-08-30 15:01 · ORM
Hibernate One to Many Annotation Example
0.pom.xml ...... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <hibernate-version>3.6.10.Final</hibernate-version> <javassist-version>3.12.1.GA</javassist-version> <slf4j-nop-version>1.6.6</slf4j-nop-version> <mysql-connector-version>5.1.21</mysql-connector-version…
2012-08-30 09:46 · ORM
Hibernate 一对一映射之外键关联 Annotation Example
0.pom.xml ...... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <hibernate-version>3.6.10.Final</hibernate-version> <javassist-version>3.12.1.GA</javassist-version> <slf4j-nop-version>1.6.6</slf4j-nop-version> <mysql-connector-version>5.1.21</mysql-connector-version…
2012-08-29 16:39 · ORM
Hibernate 一对一映射之主键关联 Annotation Example
0.pom.xml ...... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <hibernate-version>3.6.10.Final</hibernate-version> <javassist-version>3.12.1.GA</javassist-version> <slf4j-nop-version>1.6.6</slf4j-nop-version> <mysql-connector-version>5.1.21</mysql-connector-version…
2012-08-29 14:50 · ORM