Fooling around after the knowledge Point finishing, the first section, simple to build a database is MySQL, the project is MAVEN, note also comments in the code, the structure is as follows
Main knowledge points (simple example, hql operation, SQL
If the session is closed in the service (or Dao) layer without using the open session in view provided by spring, the lazy loading is true if the relationship set is initialized within the application layer, as Company.getemployees (), otherwise
1:person class
public class Person {private int id;private String name;Private Idcard Idcard;
Public Idcard Getidcard () {return idcard;}
public void Setidcard (Idcard idcard) {This.idcard = Idcard;}
public int getId () {return ID;}
public void
1 Hibernate profileHibernate is an ORM (object relation mapping objects-relational mapping) framework that is in the project's
Persistence Layer, also known as the Persistence layer framework (persistence layer framework and OJB, etc.). Hibernate is
When doing some enterprise internal projects or some Internet background, it may involve centralized rights management, unified multi-project rights management, and also need unified session management, that is, the realization of single-point
Hibernate's entity objects have three states, while entity objects are managed by the session:
(1) Transient: The state that was just created, (2) persistent: the status of the session management, the ability to synchronize with the database; (3)
Transferred from: http://blog.sina.com.cn/s/blog_5fad23090100fcgr.html
Hibernate statistics Query: Sum take the largest, take the smallest, group
One, the number of query records count (*) keyword
The test method is as follows:
Package com.bjsxt.
The goal of the WebSocketWebSocket specification is to implement bidirectional communication with the server in the browser. Two-way communication can expand the application types on the browser, such as real-time data push (stock quotes), games,
This topic to tell, hibernate environment construction, this example uses Hibernate version: Hibernate-release-4.3.8.final. This example jar file provides the download path as:http://download.csdn.net/detail/ma_hoking/8380545. Readers who need it,
Hibernate One-to-many Mappings One-to-many relationship mappingKey point: A one-to-many relationship uses the Set implementation,Example: An employee can have more than one certificate of study.steps to use Hibernate framework:
1. Create
about Windows access to Ubuntu via Remote DesktopQuestions and ObjectivesWindows environment visits Ubuntu via Remote DesktopUbuntu Machine Side1. Install the required packagesSudoapt-get Install XRDPsudo apt-get install vnc4server tightvncserver2.
1 PackageCn.happy.util;2 3 Importorg.hibernate.Session;4 Importorg.hibernate.SessionFactory;5 Importorg.hibernate.cfg.Configuration;6 7 /**8 * 1.1 Tool classes for the production of Session objects9 */Ten Public classHibernateutil { One
Original source: http://superleo.iteye.com/blog/154587Hibernate Many of the examples of many, but a closer look, most are saved, delete talk less, but there are a lot of problems, so there must be a simple test, the following we have a simple
To create a table:CREATE TABLE EMPLOYEE ( ID INT not NULL auto_increment, first_name VARCHAR () default NULL, last_name VARCHAR () default NULL, salary INT default NULL, PRIMARY KEY (ID)); CREATE table CERTIFICATE ( ID INT NOT NULL
Let's talk about the experiment project environment:
Hibernate project jar package
Hibernate-3.2.6.ga.jar
Proxool-0.9.0RC3.jar
Jdk1.6
MySQL database
Project Introduction
Hibernate uses the persistent layer of the database, in which the connection
We all know that the one-to-one ing in hibernate mainly has two policies: (1) one-to-one primary key Association (one-way and two-way ). (2) one-to-one foreign key ing (single and bidirectional ). This article mainly explains the two-way problem in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.