Project

General

Profile

Sample-vaadin-spring-hibernate » History » Version 2

Henning Blohm, 06.10.2012 15:28

1 1 Henning Blohm
h1. A sample using Vaadin with Hibernate JPA and Spring on Z2
2
3
This sample is similar to [[Sample-spring-hibernate]] but differs (or rather extends) in that it show cases
4
the use of the "Vaadin":http://www.vaadin.com user interface toolkit in conjunction with Spring implemented annotation based
5
dependency injection over Z2 modularity. 
6
7
As Spring is used throughout - in all modules - this is another practical application of [[How to Spring]].
8
9
This sample is stored in "z2-samples.vaadin-spring-hibernate":http://redmine.z2-environment.net/projects/z2-samples/repository/z2-samples-vaadin-spring-hibernate.
10
11
h2. Prerequisites
12
13
You need to run Java DB as network server on localhost. This is explained next.
14
15
The application will create a database "z2-samples"
16
17
{{include(How to run Java db)}}
18
19
20
h2. Run it
21
22
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:
23
24
<pre><code class="ruby">
25
mkdir install
26
cd install 
27
git clone -b master http://git.z2-environment.net/z2-base.core
28
git clone -b master http://git.z2-environment.net/z2-samples.vaadin-spring-hibernate
29
30
# on Linux / Mac OS:
31
cd z2-base.core/run/bin
32
./gui.sh
33
34
# on Windows:
35
cd z2-base.core\run\bin
36
gui.bat
37
</code></pre>
38
39
When running, go to http://localhost:8080/vaadin-spring-hibernate. You should see this:
40
41
!vaadin-spring-hibernate.png!
42
43
h2. Details
44
45 2 Henning Blohm
As in the other samples we have a re-use domain module. That is a recurring theme for many good reasons. In this case, the domain module *com.zfabrik.samples.vaadin-spring-hibernate.domain* is essentially like the similarly named module of [[Sample-spring-hibernate]]. The only difference is some more data access methods in the "ThingyRepository":http://redmine.z2-environment.net/projects/z2-samples/repository/z2-samples-vaadin-spring-hibernate/revisions/master/entry/com.zfabrik.samples.vaadin-spring-hibernate.domain/java/src.api/com/zfabrik/samples/vaadin_spring_hibernate/thingies/ThingyRepository.java.
46 1 Henning Blohm
47
48 2 Henning Blohm
...tbc