-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Notes on the tutorials
PostPosted: Mon Mar 06, 2006 3:05 pm 
Newbie

Joined: Sun Mar 05, 2006 4:18 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.