A few notes on the tutorial.
I'm trying out Hibernate for the first time and I'd like to use annotations so I'm sort of melding what I'm learning from each of your tutorials. (the standard one and the docs for the annotations version). I'm getting an error that the "Hibernate Dialect must be explicitly set" and discovered it's because I'm not calling configure. Perhaps in the code on this page:
http://www.hibernate.org/hib_docs/annot ... /ch01.html
you should change the line:
sessionFactory = new AnnotationConfiguration().buildSessionFactory();
to
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
That seemed to fix things for me.
Also, the line:
Interesting here is the use of AnnotationConfiguration. The packages and annotated classes are declared in your regular XML configuration file (usually hibernate.cfg.xml). Here is the equivalent of the above declaration:
It appears to indicate that the xml below is an alternate form of what is above, but what is above is the code which calls the configuration, not an alternate form of the configuration (say, pre-annotations form).
On the page:
http://www.hibernate.org/hib_docs/annot ... ntity.html
In the section 2.2 Mapping Identifier properties the example uses GeneratorType.SEQUENCE when it should be GenerationType.SEQUENCE.
Thanks for making such a great product! I'm really enjoying it. I'm planning on writing an article in the near future about using Hibernate with rich client applications.
Joshua
joshua.marinacci@sun.com