BrightSide Workbench Full Report + Source Code
org.turro.dossier.db.DossierPU Class Reference
Inheritance diagram for org.turro.dossier.db.DossierPU:
Collaboration diagram for org.turro.dossier.db.DossierPU:

Public Member Functions

String getPath (Object object)
 
- Public Member Functions inherited from org.turro.jpa.Dao
 Dao ()
 
Query createQuery (String query)
 
Query createNamedQuery (String name)
 
void close ()
 
Dao clear ()
 
void persistObject (Object obj)
 
void saveEntities (Collection<? extends IDaoEntity > entities)
 
void saveCollection (Collection objs)
 
void saveCollection (Collection objs, DaoCallback callback)
 
void deleteObject (Object obj)
 
void deleteEntity (IDaoEntity entity)
 
void deleteCollection (Collection objs)
 
void deleteCollection (Collection objs, DaoCallback callback)
 
void deleteEntities (Collection< IDaoEntity > entities)
 
EntityManager getEntityManager ()
 
EntityManager getCachedEntityManager ()
 
boolean isLoaded (Object o, String attribute)
 
boolean isNotLoaded (Object o, String attribute)
 
boolean isLoaded (Object o)
 
boolean isNotLoaded (Object o)
 
List getResultList (WhereClause wc)
 
List getResultList (WhereClause wc, int max)
 
List getResultList (WhereClause wc, int start, int max)
 
List getResultList (SqlClause sc)
 
List getResultList (SqlClause sc, int max)
 
List getResultList (SqlClause sc, int start, int max)
 
List getResultList (String query)
 
List getResultList (String query, int max)
 
List getResultList (String query, Object[] pars)
 
List getResultList (String query, Object[] pars, int max)
 
Object getSingleResult (WhereClause wc)
 
Object getSingleResult (SqlClause sc)
 
Object getSingleResult (String query)
 
Object getSingleResult (String query, Object[] pars)
 
Object getSingleResultOrNull (SqlClause sc)
 
Object getSingleResultOrNull (WhereClause wc)
 
Object getSingleResultOrNull (String query)
 
Object getSingleResultOrNull (String query, Object[] pars)
 
Object getSingleNativeResult (String query)
 
Object getSingleNativeResult (String query, Object[] pars)
 
int executeUpdate (String query)
 
int executeUpdate (String query, Object[] pars)
 
int executeDelete (JpaCriteriaDelete jpaCriteriaDelete)
 
int executeDelete (Collection< JpaCriteriaDelete > jpaCriteriaDeletes)
 
int executeUpdate (JpaCriteriaUpdate jpaCriteriaUpdate)
 
int executeUpdate (Collection< JpaCriteriaUpdate > jpaCriteriaUpdates)
 
int executeUpdate (WhereClause wc)
 
int executeUpdate (SqlClause sc)
 
int executeNativeUpdate (SqlClause sc, Object... pars)
 
int executeNativeUpdate (String query, Object... pars)
 
void poolObject (Object obj, int poolSize)
 
void finishPool ()
 

Static Public Member Functions

static String getObjectPath (Object object)
 
static String getObjectExtendedPath (Object object)
 
static Module getModule ()
 
static void convertUrls ()
 
- Static Public Member Functions inherited from org.turro.jpa.Dao
static String toJpaPositional (String query)
 
static Dao getDaoByPU (String pu)
 

Protected Member Functions

EntityManagerFactory getFactory ()
 
EntityManager createEntityManager ()
 
EntityManager createCachedEntityManager ()
 

Detailed Description

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

Definition at line 42 of file DossierPU.java.

Member Function Documentation

◆ convertUrls()

static void org.turro.dossier.db.DossierPU.convertUrls ( )
static

Definition at line 100 of file DossierPU.java.

100  {
101  if(!EntityWebUrls.existsAnyOf("/dossier")) {
102  Dao dao = new DossierPU();
103  WhereClause wc = new WhereClause();
104  wc.addClause("select d.id from Dossier as d");
105  List<Long> list = (List<Long>) dao.getResultList(wc);
106  if(!list.isEmpty()) {
107  for(Long id : list) {
108  if(!EntityWebUrls.existsEntity("/dossier/" + id)) {
109  Dossier d = dao.find(Dossier.class, id);
110  if(d != null) {
111  String url = Strings.unpunctuateKeepPath(d.getCategory().getPath()).toLowerCase() +
112  "/" + d.getId() +
113  "/" + Strings.unpunctuate(d.getDescription()).toLowerCase();
114  EntityWebUrls.addWebUrl("/dossier/" + id, url);
115  }
116  }
117  }
118  }
119  }
120  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCachedEntityManager()

EntityManager org.turro.dossier.db.DossierPU.createCachedEntityManager ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 57 of file DossierPU.java.

57  {
58  return factory.createCachedEntityManager("dossierPU", "Dossier");
59  }
synchronized EntityManager createCachedEntityManager(String pu, String conf)
Definition: DaoFactory.java:64
Here is the call graph for this function:

◆ createEntityManager()

EntityManager org.turro.dossier.db.DossierPU.createEntityManager ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 52 of file DossierPU.java.

52  {
53  return factory.createEntityManager("dossierPU", "Dossier");
54  }
EntityManager createEntityManager(String pu, String conf)
Definition: DaoFactory.java:54
Here is the call graph for this function:

◆ getFactory()

EntityManagerFactory org.turro.dossier.db.DossierPU.getFactory ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 47 of file DossierPU.java.

47  {
48  return factory.getEmf();
49  }
EntityManagerFactory getEmf()
Definition: DaoFactory.java:89
Here is the call graph for this function:

◆ getModule()

static Module org.turro.dossier.db.DossierPU.getModule ( )
static

Definition at line 96 of file DossierPU.java.

96  {
97  return new Module(new Version("1.9.5"), "BrightSide Dossier");
98  }

◆ getObjectExtendedPath()

static String org.turro.dossier.db.DossierPU.getObjectExtendedPath ( Object  object)
static

Definition at line 85 of file DossierPU.java.

85  {
86  if(object instanceof Dossier) {
87  return createCategoryPath(((Dossier) object).getCategory());
88  } else if(object instanceof Issue) {
89  return getObjectPath(((Issue) object).getDossier()) + createCategoryPath(((Issue) object).getDossier().getCategory());
90  } else if(object instanceof Category) {
91  return createCategoryPath(((Category) object).getParent());
92  }
93  return "";
94  }
static String getObjectPath(Object object)
Definition: DossierPU.java:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObjectPath()

static String org.turro.dossier.db.DossierPU.getObjectPath ( Object  object)
static

Definition at line 66 of file DossierPU.java.

66  {
67  if(object instanceof Dossier) {
68  return "/dossier/" + ((Dossier) object).getId();
69  } else if(object instanceof Issue) {
70  return "/issue/" + ((Issue) object).getId();
71  } else if(object instanceof IssueComment) {
72  return "/issue-comment/" + ((IssueComment) object).getId();
73  } else if(object instanceof Participant) {
74  return "/dossier-participant/" + ((Participant) object).getId();
75  } else if(object instanceof IssueParticipant) {
76  return "/issue-participant/" + ((IssueParticipant) object).getId();
77  } else if(object instanceof Category) {
78  return "/dossier-category/" + ((Category) object).getId();
79  } else if(object instanceof ProjectGrant) {
80  return "/project-grant/" + ((ProjectGrant) object).getId();
81  }
82  return null;
83  }
Here is the caller graph for this function:

◆ getPath()

String org.turro.dossier.db.DossierPU.getPath ( Object  object)

Reimplemented from org.turro.jpa.Dao.

Definition at line 62 of file DossierPU.java.

62  {
63  return getObjectPath(object);
64  }
Here is the call graph for this function:

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