Hi everyone,
I want to add known JPA entities programatically when creating EntityManagerFactory.
So I have this sequence (Hibernate 3.6)
Code:
Ejb3Configuration ejbConf = new Ejb3Configuration();
ejbConf.configure("TestPU", null);
ejbConf.addPackage("org.jboss.jawabot.irc.ent");
ejbConf.addPackage("org.jboss.jawabot.irc.model");
emf = ejbConf.buildEntityManagerFactory();
I also tried calling addPackage()'s before configure().
Adding packages is fine.
However, Hibernate does not find the entities. When I persist it, I get:
Quote:
Unknown entity: org.jboss.jawabot.irc.model.IrcMessage
What's wrong? How do I make Hbernate recognize entities from those packages?
Thanks,
Ondra