Hibernate in layered applications

Today I’ve made major changes to the model layer. Hibernate is soooo complicated… Maybe it’s a good thing for simple applications but in a layered one there are many issues you have to deal with.

My idea is now:

  • All collections are lazy to avoid sql queries
  • Everytime you need a collection you have to call the DAO to get it, this way you also ensure independency of the persistence mechanism used
  • When the DAO is called to get a collection it’s filtered to return only values not deleted (transactionTime.end is null)
  • findById should return a clone of the object returned by Hibernate because it’s cached, so next modifications in facades don’t affect persisted instances.

Hope this works when rerunning test cases tomorrow morning. Then I’ll commit the changes.

Spring commercial support www.springframework.com

http://www.springframework.com is now live!

Revenues from commercial activities will fund ongoing enhancements to the Spring Framework, including development, documentation, support, and testing. A substantial portion will directly fund the time of Interface21’s Director of Spring Development, Juergen Hoeller, to continue his level of commitment to the code base and user community.

The press release:
Interface21 To Provide Expert Spring Framework Consulting, Training, and Support

Hibernate3 ready for testing

The guys from Hibernate have just made available an alpha version of Hibernate3, I’m looking forward to test it when I have a bit of time.

Hibernate3 is the world’s most sophisticated ORM solution. Building on Hibernate 2.1, the de facto standard ORM implementation for Java, Hibernate3 adds a wealth of new features including: “filters” for handling temporal, regional and permissioned data, support for mixing hand-written and generated SQL, new options for mapping exotic inheritance strategies and legacy data, runtime performance monitoring via JMX, and a new event-driven architecture. See the road map for more details and have a look at the Changelog.

The “filters” for handling temporal, regional and permissioned data looks great for the ONess project.

You can download Hibernate3 here.

Improved Maven central repository upload process

Today we’ve improved the Maven central repository upload process, the time from a request to its upload to ibiblio will be much shorter from now. Hope this will make happy maven users.

Old news from ONess

23 Jul 2004 – New releases

17 Jul 2004 – New user modules: oness-user-model and oness-user-webapp

User modules to manage autentication and authorization issues.

09 Jul 2004 – Live Demo running

The live demo is running.

09 Jul 2004 – Version 0.1 Released

Available from the Sourceforge downloads page.

15 Jun 2004 – Automatic building every day (nightly snapshots)

Every day the site is regenerated with the latest stuff from CVS.

The latest source code is also built from scratch and the builds are available in the download section.

13 Jun 2004 – Auditing framework ready

The auditing framework created allows DAO objects to transparently manage data auditing information, providing support to undo operations.

10 May 2004 – Commited the sources to Sourceforge CVS

The sources are now in the Sourceforge CVS server.

19 Apr 2004 – Now featuring Hibernate + Spring model layer

The model architecture has moved from EJB to Hibernate + Spring.

7 Apr 2004 – ONess Web page is up

The oness web page at sourceforge http://oness.sourceforge.net is up.

HSQLDB and transaction isolation issues

After trying HSQLDB database it seems that doesn’t support setting transaction isolation levels, so it fails in testing.

Hibernate and postgresql

I have adapted a bit the ONess application to work with postgresql database: changed the hibernate id generator native to increment, as dbunit test insert data but don’t update sequences, and renamed user table and columns because they are reserved words.

Maven and Ant visual comparison

Maybe this helps people to better understand why to migrate to maven 😉

maven visual comparison

Whitespace programming language

Some time ago I found this cool programming language, Whitespace. The guys have really done a great work. I think it will deprecate Java 😉

Don’t forget to take a look at the samples!

Barcodes in Java applications

I’ve just checked the Barbecue project, and seems interesting if you want to use barcode in any java application.

Barbecue is an open-source, Java barcode library that provides the means to create barcodes for printing and display in Java applications. A number of barcode formats are supported and many more can be added via the flexible barcode API. Barcodes can be outputted to Graphics objects, or used as a Swing component, or written out as SVG. Please use the links on the left to find out more about Barbecue.