Just to add a few more things, when we use the hibernate3.jar in eclipse, the same code works fine.
When we pack hibernate3.jar in ear, jboss deployment fails with below error:
java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to antlr.Token
So the solution we found online was to remove the hibernate3.jar as Jboss uses its own hibernate.
Once we removed the hibernate3.jar it failed with the exception mentioned in above post
5:43:36,310 ERROR [STDERR] org.hibernate.hql.ast.QuerySyntaxException: DitRefDataDB is not mapped [FROM DitRefDataDB] - See more at: https://developer.jboss.org/inbox#sthash.RdkEu77G.dpuf