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

Public Member Functions

 DaoManager (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)
 
void clear ()
 
EntityManager getManager ()
 
Dao getDao ()
 
void close ()
 
boolean isClosed ()
 

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 37 of file DaoManager.java.

Constructor & Destructor Documentation

◆ DaoManager()

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

Definition at line 42 of file DaoManager.java.

42  {
43  this.dao = dao;
44  this.manager = dao.createEntityManager();
45  openManagers.increment();
46  }
abstract EntityManager createEntityManager()
Here is the call graph for this function:

Member Function Documentation

◆ clear()

void org.turro.jpa.DaoManager.clear ( )

Definition at line 108 of file DaoManager.java.

108  {
109  manager.clear();
110  }

◆ close()

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

Definition at line 121 of file DaoManager.java.

121  {
122  manager.close();
123  openManagers.decrement();
124  }
Here is the caller graph for this function:

◆ createNativeQuery() [1/2]

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

Definition at line 98 of file DaoManager.java.

98  {
99  return manager.createNativeQuery(clause);
100  }

◆ createNativeQuery() [2/2]

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

Definition at line 94 of file DaoManager.java.

94  {
95  return manager.createNativeQuery(clause, resultClass);
96  }
Here is the caller graph for this function:

◆ createQuery() [1/3]

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

Definition at line 86 of file DaoManager.java.

86  {
87  return manager.createQuery(delete);
88  }

◆ createQuery() [2/3]

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

Definition at line 90 of file DaoManager.java.

90  {
91  return manager.createQuery(update);
92  }

◆ createQuery() [3/3]

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

Definition at line 82 of file DaoManager.java.

82  {
83  return manager.createQuery(clause);
84  }

◆ getCounter()

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

Definition at line 134 of file DaoManager.java.

134  {
135  return openManagers;
136  }

◆ getDao()

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

Definition at line 116 of file DaoManager.java.

116  {
117  return dao;
118  }
Here is the caller graph for this function:

◆ getManager()

EntityManager org.turro.jpa.DaoManager.getManager ( )

Definition at line 112 of file DaoManager.java.

112  {
113  return manager;
114  }
Here is the caller graph for this function:

◆ isClosed()

boolean org.turro.jpa.DaoManager.isClosed ( )

Definition at line 126 of file DaoManager.java.

126  {
127  return !manager.isOpen();
128  }

◆ persist()

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

Definition at line 58 of file DaoManager.java.

58  {
59  try {
60  manager.persist(obj);
61  } catch (Exception ex) {
62  Logger.getLogger(DaoManager.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
63  }
64  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove()

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

Definition at line 70 of file DaoManager.java.

70  {
71  manager.remove(obj);
72  }
Here is the caller graph for this function:

◆ setNamedParameters()

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

Definition at line 102 of file DaoManager.java.

102  {
103  for (Map.Entry<String, Object> e : parameters.entrySet()) {
104  q.setParameter(e.getKey(), e.getValue());
105  }
106  }
Here is the caller graph for this function:

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