save()需要返回一个Serialzable的实现类,因此执行这个方法时会马上插入到数据库而persist()不会立即插入到数据库。"当我们封装一个长会话流程的时候,persist()方法就显得尤为重要了!"记录下来,防止自己再一次忘记
分类:
系统相关 时间:
2014-05-01 16:23:20
阅读次数:
1153
今天第一次使用了hibernate框架成功的实现想数据库里插入数据,初次使用可能会觉得很麻烦,但是相比较在web开发中使用原始的拼SQL语句的方法,确实方便许多.
使用hibernate,我下载的是hibernate-annotations-3.4.0.GA.zip,hibernate-distr....
分类:
系统相关 时间:
2014-05-01 13:47:47
阅读次数:
689
MySQL Administrator 创建表MyEclipse Database
Explorer视图:1. New2 .Driver template: MySQL Connector/JDriver name:
给定一个连接名称Connection URL:jdbc:mysql://[]/相应...
分类:
系统相关 时间:
2014-05-01 10:48:33
阅读次数:
696
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not...
分类:
系统相关 时间:
2014-04-29 13:15:20
阅读次数:
411
Defining annotations
Here is the definition of the annotation above. You can see that annotation definitions look a lot like interface definitions.
In fact, they compile to class files like any oth...
分类:
编程语言 时间:
2014-04-27 21:47:05
阅读次数:
348
上篇博客利用Hibernate搭建起一个简单的例子,把数据库的映射显示了出来在上一篇的博客基础上这篇博客讲述如何利用Hinbernate框架实现简单的数据库操作。
1、加入junit.jar
2、新建一个工具类HibernateUtils.Java把一些对session的公共操作封装起来
import org.hibernate.Session;
import org.hibernate.S...
分类:
系统相关 时间:
2014-04-27 21:23:59
阅读次数:
485
Annotations are one of the fundamental language changes
introduced in Java SE5. They provide information that you need to fully describe your program, but that cannot be expressed in Java. Thus, anno...
分类:
编程语言 时间:
2014-04-27 21:14:59
阅读次数:
431
将内容管理简单进行到底,鼠标一点,轻松建设属于你自己的网站。
该开源CMS使用技术,SpringMVC,Spring Security. Hibernate jQuery及其扩展插件 ,Tiles2和FreeMark。伪静态,.html请求,基于.html页面与数据库缓存Ehcache,顶住高访问量,页面缓存可设置启用关闭。...
分类:
编程语言 时间:
2014-04-27 21:13:06
阅读次数:
413
Meta-annotations
@Target
CONSTRUCTOR: Constructor declarationFIELD: Field declaration (includes enum constants) LOCAL_VARIABLE: Local variable declaration METHOD: Method declarationPACKAGE: Pack...
分类:
编程语言 时间:
2014-04-27 21:12:04
阅读次数:
385