One, persistent object lifecycleafter the application has used the Hibernate framework, the persistent objects created will undergo a complete lifecycle to perform the operation of the database, in which the main three states are transient (Transient), persistent (persistent), and out of control (detached). The conversion of these three states can be controlled in the application, as shown in the following
Java EE (Java platform,enterprise Edition) is the enterprise application version of Sun Corporation (Oracle's acquisition of April 20, 2009). This version was formerly known as the Java EE. can help us develop and deploy portable, robust, scalable, and secure server-side Java applications. Built on the
1, three layer architecturePresentation Layer Web layer (MVC is a design model of a presentation layer)Business Layer Service LayerPersistence Layer DAO Layer2. The relationship between the three frameworks and the three-tier architecture (it is recommended to learn the order of the three frameworks: Learning Hibernate before learning STRUTS2 framework and finally learning Spring
There are HQL query syntax in hibernate. But we are more familiar with the number of SQL statements, then how should we let hibernate support SQL? We don't have to think about it, the Hibernate team has already done it.Nonsense not to say, directly to the example.
It's a SQL statement, it's nonsense, it's an individual knows. We want
As an ORM framework, hibernate certainly needs to meet our need to relate tables to tables. The implementation of Hibernate in association method is very simple. Let's take a look at a one-to-one approach:Not much to say, we go directly to the code:Two entity classes, Tuser and Tpassport:
public class TUser implements serializable{
private static fina
JAVAEE--SPRING01: Introduction, construction, concept, configuration details, attribute injection and application to project Javaee--struts2_04: Custom interceptors, struts2 tags, login functions and check the implementation of the login Interceptor Java EE learning--struts2_ 03:OGNL expressions, OGNL and Struts2 combination and exercises: Customer list Java EE learning--struts2_02: Results jump mode, Acces
, Java.util.SortedSet, java.util.List , and an array of any persisted entities or values (using the Set collection type is the best choice). Properties of type Java.util.Collection or java.util.List can also be persisted using the "bag" semantics. The collection used for persistence, except for the collection interface, cannot retain any semantics attached to the class that implements these interfaces (for example, the iteration order that Linkedhashset brings). All the persistent collections, i
The Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but not to table and column operations, HQL to persistent objects and their properties. The HQL query is converted from hibernate to a traditional SQL query, which performs operations on the database on the lap.
Although you can use native SQL directly using SQL statements and hibe
mappings is almost identical to the preceding example, except with the different element and attribute names (
Bag mappingBag is a Java collection storage element that does not need to care about the order, but allows repeating elements in the list. Bag is a random grouping of objects in the list.
The collection collection is mapped to The RDBMS table and the Pojo class in the following example still use the above definition.To define a
This is your own reference Springside Integration Framework for open source projects. The main integration of spring, Spring MVC, Spring data JPA, hibernate several frameworks, still feel more comfortable in these frameworks spring data JPA the framework, the framework for writing DAO class time, only need to write an
Recently saw the custom type of hibernate, this has not been contacted before, recorded here, when it is the consolidation of their own knowledge, but also have not contacted friends to study some. The 1) custom type, as the name suggests, is of course the type that is implemented by itself because the internal type does not meet the requirements. This situation is not much, but we still need to learn, more than the pressure body. Also learn how othe
This is your own reference to the Springside Open source Project Integration Framework, the main integration of spring, Spring MVC, Spring data JPA, hibernate these frameworks, for these frameworks it feels more comfortable or spring data JPA this framework, when writing the DAO class, only need to write an interface declaration, spring data JPA will automaticall
Java framework --- CRUD operations of hibernateCRUD refers to the abbreviation of the first letter of the words "Create", "Retrieve", "Update", and "Delete" during computing. the following examples illustrate these operations: entity class: package com. oumyye. model; public class Student {private long id; private String name; private Class c; public long getId () {return id;} public void setId (long id) {t
can use Hibernate to make us adopt
object's mind-manipulating relational database, which is consistent with our thinking form.
Open Source ORM Framework
Before learning the hibernate framework, you need to understand the ORM framework first.
The ORM's full name is ORM (Obje
Hibernate Object Persistence framework and hibernate object frameworkJDBC :( Java Data Base Connectivity) java Database Connection
The java. SQL package provides JDBC APIs to write program code for accessing the database. common i
This blog is the first article on Hibernate learning. It mainly introduces the Hibernate framework, briefly introduces the directory structure of hibernate, and finally writes a simple hibernate instance. Through these three steps, we will briefly understand
Getting started with Hibernate framework Association ing and hibernate framework ing
Ing is to map the ing relationship to the database, which is one or more references in the object model.1. Configure one-way multi-to-one Association
Define a Dept attribute in the Emp class, but do not need to define the set attribute
">trueproperty>
Automatically generate table structure:property name="hbm2ddl.auto">create/update/create-drop/validateproperty>
Now we focus on the auto-generated table structure statements in other configurations of the Hibernate master configuration file, and the value of key Hbm2ddl.auto can have the following values:
Create: Delete before creating.
Update: If the table does not exist, it is created, not the same as the update
introduction of Hibernate framework
Hibernate is a further encapsulation of JDBC. One of its main starting points is the desire to simplify the programming of Java object persistence. Because the direct use of JDBC requires programmers to write a lot of complex code.
Hibernate
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.