Kategorien
Software-Entwicklung Java

How a firewall can break your app

Picture this: after we had moved an old app from an old server to a new one, we kept getting „I/O Exception: Broken Pipe“ now and then from our database connections. In the new environment, database lives on a different server than our app (as opposed to the old environment). Is there something wrong with…

Kategorien
Java

„Hibernate – A Developers Notebook“ – migrating to Hibernate 3.0, Chapter 8

Chapter 8 introduces Criteria Queries. Only QueryTest.java is affected. Besides the usual net.sf.hibernate to org.hibernate package import renaming, net.sf.hibernate.expressions in Hibernate 2 is replaced by org.hibernate.criterion. Moreover, change the line [java] Example example = Example.create(new Artist(namePattern, null, null)); [/java] to [java] Artist artist = new Artist(); artist.setName(namePattern); Example example = Example.create(artist); [/java] because Hibernate 3…

Kategorien
Software-Entwicklung

Domain-Driven Design

Die letzten Wochen habe ich „Domain-Driven Design“ von Eric Evans gelesen (bei Lehmanns, Amazon). Ich finde, dieses Buch ist für Software-Entwickler sehr empfehlenswert, die sich des objektorientierte Programmiermodells bedienen. Im Buch geht es darum, wie man gute Objektmodell für Fachdomänen erstellt (daher Domain-driven). Da es sich um ein ganzes Buch zu diesem Thema handelt, fängt…

Kategorien
Java

„Hibernate – A Developers Notebook“ – migrating to Hibernate 3.0, Chapter 7

Chapter 7 is working in Hibernate 3 (as opposed to chapter 6). The most challanging in this chapter migrationwise are StereoVolumeType.java and SourceMediaType.java . Change the import-package names. The Usertype-stuff is now under the package „org.hibernate.usertype“. It won’t compile, yet as there are some methods missing. For SourceMediaType.java: [java] public Object replace(Object original, Object target,…

Kategorien
Software-Entwicklung Medien Leben

Fernsehkanäle und Sortieralgorithmen

Wie kann ich die sich beim automatischen Sendersuchlauf ergebene zuf䬬ige Reihenfolge von TV-Kan䬥n in eine vorgegebene Reihenfolge bringen?

Kategorien
Java

„Hibernate – A Developers Notebook“ – migrating to Hibernate 3.0, Chapter 6

You can skip the entire chapter 6 if you use Hibernate 3. It is based on the interface PersistenceEnum which already became deprecated in Hibernate 2 as the author points out in the errata. The interface has apparently removed in Hibernate 3.

Kategorien
Java

„Hibernate – A Developers Notebook“ – migrating to Hibernate 3.0, Chapter 5

As in chapter 4, copy the hbm.xml-files and change the DTD-reference. Leave CreateTest.java, QueryTest.java and QueryTest2.java alone – they will still compile. Copy the AlbumTest.java file, change the hibernate-imports and the constructor calls as well as int parameters to Integer. This should be easy as we have done that before.

Kategorien
Java

„Hibernate – A Developers Notebook“ – migrating to Hibernate 3.0, Chapter 4

In this chapter, we add an Entity called „Artist“ as well as an entity called „Comments“. Copy both Track.hbm.xml and Artist.hbm.xml from the examples-distribution and remember to change the DTD-reference if necessary. When using „ant schema“, SAX complained it couldn’t find ${src.root}/com/oreilly/hh/hibernate-mapping-2.0.dtd for Artist.hbm.xml. That’s strange because it didn’t complain about it in Track.hbm.xml before.…