Skip to content

Commit dc21d1c

Browse files
committed
First commit
1 parent 583e852 commit dc21d1c

File tree

6 files changed

+4
-12
lines changed

6 files changed

+4
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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>

pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,23 @@
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>

src/main/java/net/isetjb/hibernatetutorial2/Application.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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();

src/main/java/net/isetjb/hibernatetutorial2/HibernateUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
import 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
*/

src/main/java/net/isetjb/hibernatetutorial2/Product.hbm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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">

src/main/resources/hibernate.cfg.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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>

0 commit comments

Comments
 (0)