Archive for the 'Hibernate' Category

Mai 14 2008

Create CRUD-Mashups rapidly with Naked Objects and NetBeans



In this blog i will show how easy and fast you can create Database-Mashups with full CRUD support, using Naked Objects.

Naked Objects is an open source Java-based application development platform which can use a transient (fake) or a real existing database. Support for Hibernate is included, so you can connect to every supported database.
Naked Objects also generates HTML and Window(DND) -Interfaces which are both
customizable.

Note:
Download-links to all files are available at the end of this blog-entry.


Prerequisites

Download the Naked Objects Framework http://www.nakedobjects.org/downloads/index.shtml and extract the included JAR-files from the directory “/lib“.

Naked Objects JAR files


Create the prototype

Create a new simple Java Application, name it “NakedObjectsDNDapp” and disable
the field “Create Main Class“. Naked Objects is using a specific class.

Naded Objects - create new java application


Open the project-properties and add the extracted JAR-files to the project.

Naked Objects - project properties


Switch to the category “run” and write in the field “Main Class“:

Technorati Tags: CRUD, HSQLDB, Java, Mashup, Naked Objects, NetBeans

6 responses so far

Feb 21 2008

Hibernate with Guice – Part II



Welcome back to Part II about using Hibernate with Guice. If you just stepped in, i recommend first to read Part I here.


Part II – Adding Guice to the Hibernate-Application

This application uses Guice’s Dependency Injection to create the HibernateConnection-instance and the OrdersDAO-instance. You can see that HibernateUtil don’t need STATICs anymore. Access to HibernateUtil is wrapped through a HibernateConnection which is created in a ConnectionProvider as a Singleton. Providers are acting as Factories in creating and returning Objects.

Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans

5 responses so far

Feb 21 2008

Hibernate with Guice – Part I

Published by under Guice,Hibernate,Java



In this Blog you will see how to add Google-Guice functionality to a Hibernate-Application. In Part I i will introduce a simple Hibernate-Application. In Part II you can see how this Application will be transformed for using Guice.

Note:
This was my first attempt working with Guice, so i think there are many points which can be improved.

But first for these peoples who doesn’t know what is Guice, Guice is a new lightweight Java 5 Dependency Injection Framework. It is working with Annotations. You should not compare Guice with Spring. Guice focus is on Dependency Injection, where Spring has become popular in the Java community as an alternative, replacement, or even addition to the Enterprise JavaBean model. Google produced Guice for one of their biggest applications – AdWords!

Download-links to all files are available at the end of this posting. Comments are included in the source-listings.

Technorati Tags: google guice, Hibernate, Java, mysql, NetBeans

5 responses so far