public class HibernateContextDAO extends java.lang.Object implements ContextDAO
ContextDAO
. These methods should not be used
directly, instead, the methods on the static Context
file should be used.ContextDAO
,
Context
Constructor and Description |
---|
HibernateContextDAO() |
Modifier and Type | Method and Description |
---|---|
User |
authenticate(java.lang.String login,
java.lang.String password)
Authenticate user with the given username and password.
|
void |
clearSession() |
void |
closeSession()
Close session.
|
void |
evictFromSession(java.lang.Object obj)
Used to clear a cached object out of a session in the middle of a unit of work.
|
void |
flushSession() |
User |
getUserByUuid(java.lang.String uuid)
Gets a user given the uuid.
|
void |
mergeDefaultRuntimeProperties(java.util.Properties runtimeProperties)
Takes the default properties defined in /metadata/api/hibernate/hibernate.default.properties
and merges it into the user-defined runtime properties
|
void |
openSession()
Open session.
|
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Session factory to use for this DAO.
|
void |
shutdown()
Stops the OpenMRS System Should be called after all activity has ended and application is
closing
|
void |
startup(java.util.Properties properties)
Starts the OpenMRS System
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory
- public User authenticate(java.lang.String login, java.lang.String password) throws ContextAuthenticationException
ContextDAO
authenticate
in interface ContextDAO
login
- user's username or systemIdpassword
- user's passwordContextAuthenticationException
ContextDAO.authenticate(java.lang.String, java.lang.String)
public User getUserByUuid(java.lang.String uuid)
ContextDAO
Context.getAuthenticatedUser()
method.getUserByUuid
in interface ContextDAO
uuid
- uuid of user to fetchContextDAO.getUserByUuid(java.lang.String)
public void openSession()
ContextDAO
openSession
in interface ContextDAO
public void closeSession()
ContextDAO
closeSession
in interface ContextDAO
Context.closeSession()
public void clearSession()
clearSession
in interface ContextDAO
ContextDAO.clearSession()
public void evictFromSession(java.lang.Object obj)
ContextDAO
evictFromSession
in interface ContextDAO
obj
- The object to evict/remove from the sessionContextDAO.evictFromSession(java.lang.Object)
public void flushSession()
flushSession
in interface ContextDAO
ContextDAO.flushSession()
public void startup(java.util.Properties properties)
ContextDAO
Should be called prior to any kind of activity
startup
in interface ContextDAO
properties
- PropertiesContext.startup(Properties)
public void shutdown()
ContextDAO
shutdown
in interface ContextDAO
Context.shutdown()
public void mergeDefaultRuntimeProperties(java.util.Properties runtimeProperties)
mergeDefaultRuntimeProperties
in interface ContextDAO
runtimeProperties
- The current user specific runtime propertiesContextDAO.mergeDefaultRuntimeProperties(java.util.Properties)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.