hmis-tools / hmis-api-server

Version 2 of OpenHMIS
Mozilla Public License 2.0
15 stars 11 forks source link

Move creds out of hibernate config file #42

Closed cecilia-donnelly closed 8 years ago

cecilia-donnelly commented 8 years ago

Currently, any new endpoints require users to copy the hibernate.cfg.xml.example file and re-insert their credentials into it. This is an easy step to miss, so let's keep the mappings under version control and just insert the credentials into hibernate.cfg.xml from some global config file.

By the way, for future searches, the error I got because I didn't update my hibernate config looked like this:

HTTP Status 500 - org.hibernate.hql.internal.ast.QuerySyntaxException: TmpChronicHealthCondition is not mapped [select chronicHealthCondition from TmpChronicHealthCondition as chronicHealthCondition]

javax.servlet.ServletException: org.hibernate.hql.internal.ast.QuerySyntaxException: TmpChronicHealthCondition is not mapped [select chronicHealthCondition from TmpChronicHealthCondition as chronicHealthCondition]
    org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:423)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)