File tree Expand file tree Collapse file tree 6 files changed +4
-12
lines changed
java/net/isetjb/hibernatetutorial2 Expand file tree Collapse file tree 6 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Hibernate XML Mapping files *(Obsolete !!! We will see in Tutorial 3 the mode "H
44[ ![ contributions welcome] ( https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat )] ( https://github.com/nfriaa/hibernate-tutorial2/issues ) [ ![ Travis] ( https://img.shields.io/travis/rust-lang/rust.svg )] ( https://github.com/nfriaa/hibernate-tutorial2 ) [ ![ license] ( https://img.shields.io/github/license/mashape/apistatus.svg )] ( https://github.com/nfriaa/hibernate-tutorial2/blob/master/LICENSE )
55
66## Description
7- A sample code to execute Queries under Hibernate ORM (not directly to sql)
7+ A sample code to execute Queries under Hibernate ORM (not directly to sql)
88* JavaSE 1.8
99* Hibernate 5
1010* Maven 4
@@ -76,7 +76,7 @@ public class Product
7676 <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/persist_db</property>
7777 <property name="hibernate.connection.username">root</property>
7878 <property name="hibernate.connection.password">root</property>
79- <property name="show_sql">true</property>**
79+ <property name="show_sql">true</property>
8080 <mapping file="src/main/java/net/isetjb/hibernatetutorial2/Product.hbm.xml"/>
8181 </session-factory>
8282</hibernate-configuration>
Original file line number Diff line number Diff line change 55 <artifactId >hibernate-tutorial2</artifactId >
66 <version >1.0.0</version >
77 <packaging >jar</packaging >
8-
98 <properties >
109 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
1110 <maven .compiler.source>1.8</maven .compiler.source>
1211 <maven .compiler.target>1.8</maven .compiler.target>
1312 </properties >
14-
1513 <dependencies >
16-
1714 <!-- MySQL connector -->
1815 <dependency >
1916 <groupId >mysql</groupId >
2017 <artifactId >mysql-connector-java</artifactId >
2118 <version >6.0.6</version >
2219 </dependency >
23-
2420 <!-- Hibernate -->
2521 <dependency >
2622 <groupId >org.hibernate</groupId >
2723 <artifactId >hibernate-core</artifactId >
2824 <version >5.2.11.Final</version >
2925 </dependency >
30-
3126 </dependencies >
32-
3327</project >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public static void main(String[] args)
2525 // Open connection pool
2626 factory = HibernateUtil .getSessionFactory ();
2727
28+ // CRUD calls examples
2829 addProduct ("ff" , 44 );
2930 addProduct ("gg" , 22 );
3031 listProducts ();
Original file line number Diff line number Diff line change 44import org .hibernate .cfg .Configuration ;
55
66/**
7- * Hibernate Utility class with a convenient method to get Session Factory
8- * object.
7+ * Singleton Hibernate Utility class with a method to get Session Factory.
98 *
109 * @author Nafaa Friaa (nafaa.friaa@isetjb.rnu.tn)
1110 */
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
33"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
4-
54<hibernate-mapping >
65 <class name =" net.isetjb.hibernatetutorial2.Product" table =" product" >
76 <meta attribute =" class-description" >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
33"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
4-
54<hibernate-configuration >
65 <session-factory >
76 <property name =" hibernate.dialect" >org.hibernate.dialect.MySQLDialect</property >
You can’t perform that action at this time.
0 commit comments