摘要:从 iBatis 到 MyBatis,你准备好了吗?对于从事 Java EE 的开发人员来说,iBatis 是一个再熟悉不过的持久层框架了,在 Hibernate、JPA 这样的一站式对象 / 关系映射(O/R Mapping)解决方案盛行之前,iBaits 基本是持久层框架的不二选择。即使在持久层框架层出不穷的今天,iBatis 凭借着易学易用、轻巧灵活等特点,也仍然拥有一席之地。尤其对于擅长 SQL 的开发人员来说,iBatis 对 SQL 和存储过程的直接支持能够让他们在获得 iBatis 封装优势的同时而不丧失 SQL 调优的手段,这是 Hibernate/JPA 所无法比拟的。具体而
阅读全文
随笔分类 - mybatis3
摘要:I have a very simple MySql table with an auto increament primary key,1CREATE TABLE sampah2(3id INT(10) NOT NULL AUTO_INCREMENT,4name VARCHAR(30),5PRIMARY KEY (id)6)my question is, how can i get my object’s generated primary key if i insert a new object to table “sampah”?The answer is actually quite
阅读全文
摘要:One of the latest MyBatis feature is the ability to use Annotations or XML to do One-to-One or One-to-Many queries. Let’s start with an example, as usual im using PostgreSQL, Netbeans 6.9 and MyBatis 3.0.2.First is a simple database with 2 different tables,CREATE DATABASE test CREATE TABLE master ..
阅读全文