Project

General

Profile

Actions

Sample-hibernate-basic » History » Revision 6

« Previous | Revision 6/32 (diff) | Next »
Henning Blohm, 16.09.2012 19:31


A plain Hibernate on Z2 sample

Note that Hibernate is used in other samples as well, such as Sample-jta-plain, Sample-jta-spring, and others. This sample shows the minimal things to do to use Hibernate as an implementation of the Java Persistence API (JPA).

This sample is stored in the repository z2-samples.hibernate.basic.

Prerequisites

You need the z_tx_tests database on a local MySQL database system. Start the MySQL client as the root user and run:

create database z_tx_tests;
grant all on z_tx_tests.* to tx@localhost identified by 'tx';

Run it

Like all samples, also this sample can be run as in How to run a sample. If you have the database, the fastest way to verify whether it runs is:

mkdir install
cd install 
git clone -b master http://git.z2-environment.net/z2-base.core
git clone -b master http://git.z2-environment.net/z2-samples.hibernate-basic

# on Linux / Mac OS:
cd z2-base.core/run/bin
./gui.sh

# on Windows:
cd z2-base.core\run\bin
gui.bat

Details

The assumption of this example is that of a re-use domain module that implements a "Thingy Repository" and is used from a web application that is in another module.

If everything would happen inside one module, the structure could be kept even simpler.

Updated by Henning Blohm over 11 years ago · 6 revisions