[opencms-dev] OpenJpa - best way to access EntityManager inside OpenCms

Georgi Naplatanov gosho at oles.biz
Tue Apr 23 14:18:07 CEST 2013


Hi,

You have looked where the methods are - > org.opencms.db.jpa.CmsSqlManager

If you want to use EntityManager instances from OpenCms' persistence 
unit and use corresponding db pool, use 
getEntityManager()/returnEntityManager, but if you want to use different 
persistence unit - use getFactory() or createEntityManager().

The source code is very simple so it's your friend :)

HTH

Best regards
Georgi

On 04/23/2013 02:22 PM, � wrote:
> Hi,
> I am working on Opencms module which has a requiremnt of storing some
> data in db(one entity class). I would like to use openjpa, because I
> know that it's supported and used in Opencms, but I was not able to find
> any tutorial, example or any piece of solid documentation(except for
> this
> http://www.opencms.org/javadoc/core/org/opencms/db/jpa/CmsSqlManager.html)
> on how to access and initialize EntityManager and what are the best
> practices for using OpenJpa with Opencms.�
> Does anybody here have any suggestions or tips?�
> Thanks.
>
> Jakub Je�m�nek
> ------------------------------------------------
> NELASOFT Technologies, s.r.o.
> Mob: +420 604 575 772
> E-mail: jakub.jecminek at nelasoft.cz <mailto:jakub.jecminek at nelasoft.cz>
> Web: www.nelasoft.cz <http://www.nelasoft.cz>
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>



More information about the opencms-dev mailing list