BrightSide Workbench Full Report + Source Code
org.turro.jpa.DaoTransaction Class Reference
Inheritance diagram for org.turro.jpa.DaoTransaction:
Collaboration diagram for org.turro.jpa.DaoTransaction:

Public Member Functions

 DaoTransaction (Dao dao)
 
void persist (Object obj)
 
void remove (Object obj)
 
Query createQuery (String clause)
 
Query createQuery (CriteriaDelete delete)
 
Query createQuery (CriteriaUpdate update)
 
Query createNativeQuery (String clause, Class resultClass)
 
Query createNativeQuery (String clause)
 
void setNamedParameters (Query q, Map< String, Object > parameters)
 
Dao getDao ()
 
void close ()
 

Static Public Member Functions

static AtomicCounter getCounter ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file DaoTransaction.java.

Constructor & Destructor Documentation

◆ DaoTransaction()

org.turro.jpa.DaoTransaction.DaoTransaction ( Dao  dao)

Definition at line 43 of file DaoTransaction.java.

43  {
44  this.manager = new DaoManager(dao);
45  this.transaction = manager.getManager().getTransaction();
46  startTransaction();
47  }
EntityManager getManager()
Here is the call graph for this function:

Member Function Documentation

◆ close()

void org.turro.jpa.DaoTransaction.close ( )

Definition at line 106 of file DaoTransaction.java.

106  {
107  if(transaction != null && transaction.isActive()) {
108  try {
109  transaction.commit();
110  } catch (Exception ex) {
111  Logger.getLogger(DaoTransaction.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
112  try {
113  transaction.rollback();
114  } catch (Exception e) {
115  throw new ElephantException(e);
116  }
117  } finally {
118  manager.close();
119  openTransactions.decrement();
120  }
121  } else {
122  manager.close();
123  }
124  }
Here is the call graph for this function:

◆ createNativeQuery() [1/2]

Query org.turro.jpa.DaoTransaction.createNativeQuery ( String  clause)

Definition at line 91 of file DaoTransaction.java.

91  {
92  return manager.createNativeQuery(clause);
93  }
Query createNativeQuery(String clause, Class resultClass)
Definition: DaoManager.java:94
Here is the call graph for this function:

◆ createNativeQuery() [2/2]

Query org.turro.jpa.DaoTransaction.createNativeQuery ( String  clause,
Class  resultClass 
)

Definition at line 87 of file DaoTransaction.java.

87  {
88  return manager.createNativeQuery(clause, resultClass);
89  }
Here is the call graph for this function:

◆ createQuery() [1/3]

Query org.turro.jpa.DaoTransaction.createQuery ( CriteriaDelete  delete)

Definition at line 79 of file DaoTransaction.java.

79  {
80  return manager.createQuery(delete);
81  }

◆ createQuery() [2/3]

Query org.turro.jpa.DaoTransaction.createQuery ( CriteriaUpdate  update)

Definition at line 83 of file DaoTransaction.java.

83  {
84  return manager.createQuery(update);
85  }

◆ createQuery() [3/3]

Query org.turro.jpa.DaoTransaction.createQuery ( String  clause)

Definition at line 75 of file DaoTransaction.java.

75  {
76  return manager.createQuery(clause);
77  }

◆ getCounter()

static AtomicCounter org.turro.jpa.DaoTransaction.getCounter ( )
static

Definition at line 137 of file DaoTransaction.java.

137  {
138  return openTransactions;
139  }

◆ getDao()

Dao org.turro.jpa.DaoTransaction.getDao ( )

Definition at line 99 of file DaoTransaction.java.

99  {
100  return manager.getDao();
101  }
Here is the call graph for this function:

◆ persist()

void org.turro.jpa.DaoTransaction.persist ( Object  obj)

Definition at line 55 of file DaoTransaction.java.

55  {
56  manager.persist(obj);
57  }
void persist(Object obj)
Definition: DaoManager.java:58
Here is the call graph for this function:

◆ remove()

void org.turro.jpa.DaoTransaction.remove ( Object  obj)

Definition at line 63 of file DaoTransaction.java.

63  {
64  manager.remove(saveObject(obj));
65  }
void remove(Object obj)
Definition: DaoManager.java:70
Here is the call graph for this function:

◆ setNamedParameters()

void org.turro.jpa.DaoTransaction.setNamedParameters ( Query  q,
Map< String, Object >  parameters 
)

Definition at line 95 of file DaoTransaction.java.

95  {
96  manager.setNamedParameters(q, parameters);
97  }
void setNamedParameters(Query q, Map< String, Object > parameters)
Here is the call graph for this function:

The documentation for this class was generated from the following file: