Posted on 2007-09-16 15:14
TuringJava 阅读(485)
评论(0) 编辑 收藏 所属分类:
Hibernate
最近正在学习Hibernate,利用的是Myeclipse开发平台,在网上转悠了一大圈找到了几个比较好的入门学习实例。
Example1:http://www.myeclipseide.com/images/tutorials/quickstarts/introduction_to_hibernate/tutorial.html
Example2:http://www.myeclipseide.com/documentation/quickstarts/hibernate/
Example3:
http://www.roseindia.net/hibernate/firstexample.shtml
Simple Introduce to Hibernate:
1.Hibernate is an OR-mapping technology that is used to map database structures to Java objects at runtime.
2. Two important configuration files:
hibernate.cfg.xml. On startup, Hibernate consults this XML file for its operating properties, such as database connection string and password, database dialect, and mapping files locations. Hibernate searches for this file on the classpath.
mapping description file (file extension *.hbm) that instructs Hibernate how to map data between a specific Java class and one or more database tables.
3.user for
Hibernate may be used by any Java application that requires moving data between Java application objects and database tables. Thus, it's very useful in developing two and three-tier J2EE applications. Integration of Hibernate into your application involves:
- Installing the Hibernate core and support JAR libraries into your project
- Creating a hibernate.cfg.xml file to describe how to access your database
- Creating individual mapping descriptor files for each persistable Java classes
开发过程:
1.Config the hibernate.cfg.xml to connect the DataBase
2.Writting the Persistance Class -POJO
3.Mapping the POJO toDB, using **.hbm.xml
4.Develop the Application