I used AnnotationConfiguration before but now is deprecated
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.addAnnotatedClass(Product.class);
factory = cfg.buildSessionFactory();
So now it’s recommended to use Configuration insted, but still get some error:
.
How build a session factory now ?
So you are using some pretty new version, 4.0.0.CR4 perhaps? If so, then check the Javadoc of buildSessionFactory and it will tell you following:
No idea though is suggested replacement working, never used it.