org.mentawai.util
Class JPAHelper

java.lang.Object
  extended by org.mentawai.util.JPAHelper

public class JPAHelper
extends Object

JPA Utilities Java Persistence API JSR 220 - http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html

Author:
Fernando Boaglio

Constructor Summary
JPAHelper()
           
 
Method Summary
static javax.persistence.EntityManager beginTransaction()
          get transaction start
static void closeEntityManagerForQueries(javax.persistence.EntityManager em)
          Close EM for SELECTs
static void commitTransaction(javax.persistence.EntityManager em)
          get transaction end
static boolean existsJPAPersistenceUnit()
          Check if exists a defined persistence unit
static javax.persistence.EntityManager getEntityManagerForQueries()
          Get EM for SELECTs
static void setPersistenceUnit(String value)
          Set Persistence Unit value for ApplicationManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAHelper

public JPAHelper()
Method Detail

setPersistenceUnit

public static void setPersistenceUnit(String value)
Set Persistence Unit value for ApplicationManager

Parameters:
value -

beginTransaction

public static javax.persistence.EntityManager beginTransaction()
get transaction start

Returns:
EntityManager

commitTransaction

public static void commitTransaction(javax.persistence.EntityManager em)
get transaction end

Parameters:
em -

getEntityManagerForQueries

public static javax.persistence.EntityManager getEntityManagerForQueries()
Get EM for SELECTs

Returns:
EntityManager

closeEntityManagerForQueries

public static void closeEntityManagerForQueries(javax.persistence.EntityManager em)
Close EM for SELECTs


existsJPAPersistenceUnit

public static boolean existsJPAPersistenceUnit()
Check if exists a defined persistence unit

Returns:
boolean


Copyright © 2013. All Rights Reserved.