In part 1 of this series, I introduced you to some of the subtleties associated with persisting domain instances with GORM. This time, I’m going to tackle relationships with particular focus on hasMany and belongsTo.
GORM provides only a few basic elements for defining relationships between domain classes, but they are sufficient to describe most needs. When I give training courses on Grails, it always surprises me how few slides cover relationships. As you can imagine, this apparent simplicity does hide some subtle behaviour that can trip up the unwary. Let’s start with the most basic of relationships: the many-to-one.
Hot on the heels of the STS on Eclipse 3.6 and Gemini Web milestone announcements, I am glad to report that the first milestone of Gemini Blueprint is available for download. Part of the Gemini project, Blueprint builds on top of the Spring Dynamic Modules v2 code base and is the Reference Implementation for the OSGi 4.2 Blueprint specification. Besides the changes reflecting the transition to the Eclipse Foundation, 1.0.0.M1 code base has been upgraded to the latest Spring framework release.
Gemini Blueprint is dual licensed under Apache License and Eclipse Public License.
Last week the Eclipse Foundation released the much anticipated next version of Eclipse. You can download Eclipse 3.6 aka Helios from SpringSource’s member distribution page. Also check out the New & Noteworthy for this release.
The Tools Team at SpringSource has been busy updating our developer tools to support Eclipse 3.6 and while we haven’t released a new version of SpringSource Tool Suite that builds on and bundles 3.6 yet, users can now install STS on top of Eclipse 3.6.
Detailed steps to install STS from our nightly update sites can be found in the installation instructions. Please carefully follow the outlined steps in the “Installing from the Nightly Snapshot Update Site” section starting on page 9.
SpringSource developed the Reference Implementation of the OSGi Web Container and then contributed the code to Eclipse as the Web sub-project of Gemini. The goal of Gemini is to provide modular implementations of Java EE technology. Gemini Web provides servlet and JSP technology.
Gemini Web runs on the Equinox OSGi framework and embeds Tomcat. It is also integrated into the Eclipse Virgo web server.
SpringSource’s Tomcat expert, Mark Thomas, describes the details of the release at TomcatExpert.com.In addition to the implementation of the Servlet 3.0, JSP 2.2 and EL 2.2 specifications, Tomcat 7 boasts a number of new features:
- memory leak prevention and detection
- protection against session fixation attacks
- a simple filter to add cross-site request forgery protection to an application
- simplified embedding
- alias support
- better security for the Manager and Host Manager applications
Are you new to Grails? Or have you perhaps run into your first GORM “oddity”? If so, then you’ll want to read this series on GORM gotchas. Not only will the articles highlight those little idiosyncrasies that often catch people out, but they will also explain why GORM behaves in these ways.
Hopefully you will already know that GORM is the database access library that comes with Grails. It’s based on probably the most popular Java ORM out there: Hibernate. As you can imagine, Hibernate is a powerful and flexible library and it brings big benefits to GORM. But there is a cost to using it: many of the problems that users of GORM run into stem from the way Hibernate works. GORM tries to hide the implementation details as best it can, but they do leak out on occasion.
The first milestone (2.1.0.M01) of Eclipse Virgo is now available for download under the Eclipse Public License. This consists of an application server, known as the Virgo Web Server, and a stand-alone kernel.
The goal of this milestone is for dm Server 2.0.x users to be able to migrate to it relatively painlessly and have an equally stable environment. SpringSource is offering commercial support for Virgo and we encourage all dm Server users to migrate to Virgo. The main communication channel with users is now the Virgo forum. There is also a Virgo developer mailing list and a weekly Virgo community call.
Please note that we are not providing a dependencies download anymore. The recommended way of obtaining third-party libraries for use with Spring is Maven/Ivy; you could also download third-party distributions of your choice and take the jars from there. Note that there is no reason to upgrade third-party libraries unless you want to: The simplest solution is to keep using the versions that you know and trust.