Fix problem with method of class hashCode

Write JUnit test for hibernate relationship test.
Also fix mistake in javadoc.