I am new to Hibernate and need help getting results from a JDNI dataSource. Using JDBC I am able to view connection info like this.
//jdbc
conn = DbConnectionFactory.getConnection(ContextType.JNDI_WORKFLOW_DATA);
log.info("Connnection INFO :" + conn);
Do I have to use the DbConnectionFactory for hibernate in order to view connection Info? I have jndi datasource hibernateProperties in xml file like this.
<property name="hibernateProperties">
<props>
<prop key="hibernate.connection.datasource">java:/env/jdbc/data</prop>
Whenever I try to get the results like this I get a QuerySyntaxException saying ReferenceModel is not mapped. How do I map my RefernceModel?
//hibernate
Session session = sessionFactory.openSession();
List<ReferenceModel> jsonData = (List<ReferenceModel>) session.createQuery("select State, from STATE").list();