joscha / play-authenticate

An authentication plugin for Play Framework 2.x (Java)
http://joscha.github.com/play-authenticate/
Other
807 stars 366 forks source link

JPA Hibernate implementation #270

Open skelt opened 9 years ago

skelt commented 9 years ago

Hello,

I've created a sample project with JPA and Hibernate if anyone is looking for a solution.

https://github.com/skelt/play-authenticate-hibernate

Cheers, Stewart.

Mule52 commented 8 years ago

Thank you for providing this version with JPA and Hibernate. I wanted to move away from ebean and this is working for me. Are there any known issues with this sample app? Does everything work as expected?

Thanks for the hard work.

skelt commented 8 years ago

Hi,

Apart from the build.sbt needing updated to support the latest version of play, hibernate and mysql it should be good to go. I still use it with my projects, but I do use a more complete version with user management and an admin dashboard that I’m not allowed to share due to company policy.

You just need to be careful with closing connections to the database. If you use @transactional and it works you don’t need to worry, but if you use em = JPA.em(JpaConstants.DB) you need to call em.close() after you have finished with the database. If you don’t you’ll end up with a connection leak - @transactional is designed to do this for you, so use it where you can.

Glad you appreciate the version.

Stewart.

From: Mule52 notifications@github.com<mailto:notifications@github.com> Reply-To: joscha/play-authenticate reply@reply.github.com<mailto:reply@reply.github.com> Date: Wednesday, 30 March 2016 at 05:36 To: joscha/play-authenticate play-authenticate@noreply.github.com<mailto:play-authenticate@noreply.github.com> Cc: Stewart Kelt Stewart.Kelt@uws.ac.uk<mailto:Stewart.Kelt@uws.ac.uk> Subject: Re: [joscha/play-authenticate] JPA Hibernate implementation (#270)

Thank you for providing this version with JPA and Hibernate. I wanted to move away from ebean and this is working for me. Are there any known issues with this sample app? Does everything work as expected?

Thanks for the hard work.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/joscha/play-authenticate/issues/270#issuecomment-203245274

Please consider the environment and think before you print University of the West of Scotland is a registered Scottish charity. Charity number SC002520. Legal disclaimer The information transmitted is the property of University of the West of Scotland and intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Statements and opinions expressed in this e-mail may not represent those of the University. Any review, retransmission, dissemination and other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.

Mule52 commented 8 years ago

Stewart,

Thanks again for the project port and the advice. I have your solution working in my project. Now I need to upgrade to Play 2.5.

Alex