hibernate1

Hibernate: One To One Example using Annotation

In this tutorial, you will learn how to work with one to one table relationship in Hibernate using Annotation. Tools & technologies used in this article: Java 1.6 Maven 3.2. Hibernate 4.x Oracle 11.2.0 Eclipse One-to-one relationship between TABLE A and TABLE B is as follows. Each row in a TABLE A is linked to 1 and […]

hibernate1

Hibernate: One To One Example using XML mapping

In this tutorial, you will learn how to work with one to one table relationship in Hibernate using XML mapping. Tools & technologies used in this article: Java 1.6 Maven 3.2. Hibernate 4.x Oracle 11.2.0 Eclipse One-to-one relationship between TABLE A and TABLE B is as follows. Each row in a TABLE A is linked to […]

hibernate

CRUD (Create,Read,Update,Delete) operations using JPA 2.1 (Hibernate entity manager) + Maven 3.2.3 + Oracle 11.2

In this tutorial, we will explain how to make CRUD operations using JPA 2.1 (Hibernate entity manager) Tools & technologies used in this article: Java 1.6 Maven 3.2. Hibernate Entity manager 4.3.6 Oracle 11.2.0 Eclipse 1)  POM.xml Add Hibernate  entity manager 4.3.6 and Oracle 11.2.0 dependencies to the project.

 2)  Create  resources/META-INF folder under “src/main” […]

hibernate1

CRUD (Create,Read,Update,Delete) operations using Hibernate 4.3.6 + Maven 3.2.3 + Oracle 11.2 + XML mapping

In this tutorial, we will explain how to make CRUD operations using Hibernate 4.3.6. Tools & technologies used in this article: Java 1.6 Maven 3.2. Hibernate 4.x Oracle 11.2.0 Eclipse 1)  POM.xml Add Hibernate 4.3.6 and Oracle 11.2.0 dependencies to the project.

2)  Create a resources folder under “src/main” folder,  and add Hibernate configuration […]

hibernate1

Hibernate development environment setup with Maven and Eclipse

In this tutorial, we will explain, how to set up hibernate using Maven and Eclipse. Tools & technologies used in this article: 1. Java 1.6 2. Maven 3.2.3 3. Hibernate 4.x 4. Oracle 11.2.0 5. Eclipse 1) Create Maven project in Eclipse In project explorer, Right click -> choose New ->Other and Select Maven as below.   […]

How to get 120 with five zeros by doing any arithmetic operation?

Answer is simple. We have to use factorial to get 120.

Let me explain how o!=1. We know that, n! can be defined as below.

substitute n=1.

So 0!=1

hibernate1

What is Hibernate mapping file?

Hibernate mapping file is used to map java object to the database table. We can have any number of mapping files in a project. Each hibernate mapping file must contain only one <id> tag (or relevant tag <composite-id>) <id> tag corresponds to either primary key or Non primary key. Hibernate need unique key to map […]

hibernate1

What is dialect class in Hibernate?

To connect to any database with hibernate, we need to specify the SQL dialect class in hibernate.cfg.xml      Ex: To connect to oracle database we need to specify oracle dialect class in configuration xml as below.

Dialect class is java class, which contains code to map between java language data type database data […]

hibernate1

What is Hibernate configuration file?

Hibernate uses this file to establish connection to the database server. It is an XML file which is used to define DataBase connection details: Driver class, URL, username and Password. Hibernate properties: Dialect, show_sql, second_level_cache ..etc Mapping files names. One configuration file for each database. Standard name for this file is hibernate.cfg.xml Syntax of Configuration xml: […]