Can you try with JPA-QL instead of sql?
Or when you call addEntity. Try putting the full package/classname as the
String. "org.stockdomain.domain.Stock"
I never use SQL with addEntity, I would always use JPA-QL myself, but that doesn't mean that what you did was wrong.
so JPA-QL would be
String ql = "Select * from Stock"
return sessionFactory.getCurrentSession().createQuery(ql).list();
I suggest trying with JPA-QL to see what the real problem could be. Is it the String "Stock" or something more than just that.
Mark