Hi,
I created a small desktop project using Hibernate, to understand how enterprise patterns are applied in there.
I'm using annotations, and wrote a class to wrap my session factory
public class Hibernation {
private static final SessionFactory sessionFactory;
static{
try{
//sesionFactory = new org.hibernate.cfg.Configuration().configure().buildSessionFactory();
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
}
catch(Throwable e){
throw new ExceptionInInitializerError(e);
}
}
public static Session getSession(){
return sessionFactory.openSession();
}
}
However, whenever i try to run it, I get this error:
Caused by: java.lang.ClassNotFoundException: javax.persistence.ElementCollection
The jars in my classpath do not seem to have that class inside them
hibernate3.jar
jpa.jar
log4j-1.2.15.jar
persistence-api-1.0.jar
slf4j-log4j12-1.0.1.jar
I've looked around for that class, but I can't find where to download it from. Any idea what jar file i'm missing? I looked inside javaee.jar, where there are many javax.persistence.*** clases, but its not there either.
Thanks in advance.