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…
Kategorie: Java
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…
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,…
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.
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.
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.…
JSSE 1.0 bug keeps me busy
A bug in JSSE 1.0.3 keeps me busy the whole monday – ending up with migrating from JDK1.2.2 to JDK1.4.2 „out of the cold“. In one of my maintenance project that realize some kind of an online-shop, „we“ use a third-party website for payment. Last friday afternoon they installed a new SSL-certificate. Since then, the…
In chapter 3 (you can read it online) we use the Track table to insert some data and to query data. We use CreateTest to create and QueryTest to query data. Some simple adaptions are necessary: change package name of hibernate classes to org.hibernate replace the use of the all-attributes-as-parameters-constructor with Java-Bean style use of…