I need to use apache shiro (jsecurity) to build security stuff for my project. Shior contains a class JdbcRealm which can access the database. However, it uses plain jdbc connection. I would like JdbcRealm to access to the backend database e.g. mysql using hibernate so that the persistence layer would be consistent.
Now my question arises. After searching on the internet and reading the doucument. I can not find information referring that developer can use standard api e.g. EntityManager/ EntityManagerFactory to obtain data source set in the JdbcRealm so that Shiro (jsecurity) can access to the database.
The only info so far I discovered is at
http://docs.jboss.org/hibernate/stable/ ... ogrammatic. It looks like I am able to use Configuration class to obain the datasource information. However, I can not figure out a way to use standard jpa api e.g. EntityManager to access to it.
Would anyone please give me a hint on how to do it? or any resource related?
I appreciate any suggestion.
Thank you very much.