Your Trail java > Persistence
Copyright Information
1 Introduction
Persistent is the opposite of transient. In a Java application,
there are classes that come and go: you create them, use them, and discard them.
Some other classes such as database related classes, will not go away after you quit the application,
they (or their data) are stored in a pesistent external storage. These are called persistent classes.
2 Bean Managed Persistence (BMP)
In BMP, developers take care of persistence.
3 Container Managed Persistence (CMP)
Container Managed Persistence (CMP) is more strategic
Vendor takes care of everything by using O-R or OODB mappings using metadata.
A developer cannot optimize performance as the vendor takes care of it .
Introduction
Hibernate is a Java persistence layer toolset.
It maps between Java classes to database tables and from Java data types to SQL data types, bidirectionally. Hibernate also provides data query and retrieval facilities.
The whole purpose of Hibernate was to reduce development time otherwise spent with manual data handling in SQL and JDBC.
Installation
Download a copy of Hibernate from Hibernate website
run ant to install hibernate
test your hibernate installation
update etc/hibernate.properties according to your system configuration
make sure your JDBC driver is in $HIBERNATE_HOME/lib
run "ant eg"
A simple hibernate example
Trust me, hibernate has excellent documentations, you'll see after...[more ]
Object Relational Bridge
...[more ]
{ Per*sist"ence (?), Per*sist"en*cy (?), }
n. [See Persistent .] 1.
The quality or state of being persistent; staying or continuing
quality; hence, in an unfavorable sense, doggedness;
obstinacy.
2. The continuance of an effect after the
cause which first gave rise to it is removed ; as:
(a) (Physics) The persistence of
motion. (b) (Physiol.) Visual
persistence , or persistence of the visual impression;
auditory persistence , etc.
(search time: 24.618 msec)
persistence ['p2'sist2ns] 坚持,持续,坚持不懈
(search time: 177.661 msec)