Skip to content

Instantly share code, notes, and snippets.

@fabiokung
Created July 29, 2008 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiokung/3179 to your computer and use it in GitHub Desktop.
Save fabiokung/3179 to your computer and use it in GitHub Desktop.
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.configure();
cfg.addAnnotatedClass(Produto.class);
cfg.addAnnotatedClass(Categoria.class);
// ...
SessionFactory factory = cfg.buildSessionFactory();
Session session = factory.openSession();
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment