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

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 39 of file PublicationPU.java.

Member Function Documentation

◆ convertUrls()

static void org.turro.publication.db.PublicationPU.convertUrls ( )
static

Definition at line 87 of file PublicationPU.java.

87  {
88  if(!EntityWebUrls.existsAnyOf("/publication")) {
89  Dao dao = new PublicationPU();
90  WhereClause wc = new WhereClause();
91  wc.addClause("select p.id from Publication as p");
92  List<Long> list = (List<Long>) dao.getResultList(wc);
93  if(!list.isEmpty()) {
94  for(Long id : list) {
95  if(!EntityWebUrls.existsEntity("/publication/" + id)) {
96  Publication p = dao.find(Publication.class, id);
97  if(p != null) {
98  EntityWebUrls.addWebUrl(
99  "/publication/" + id,
100  "/" + p.getId() + "/" + Strings.unpunctuate(p.getTitle()).toLowerCase());
101  }
102  }
103  }
104  }
105  }
106  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCachedEntityManager()

EntityManager org.turro.publication.db.PublicationPU.createCachedEntityManager ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 54 of file PublicationPU.java.

54  {
55  return factory.createCachedEntityManager("publicationPU", "Publication");
56  }
synchronized EntityManager createCachedEntityManager(String pu, String conf)
Definition: DaoFactory.java:64
Here is the call graph for this function:

◆ createEntityManager()

EntityManager org.turro.publication.db.PublicationPU.createEntityManager ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 49 of file PublicationPU.java.

49  {
50  return factory.createEntityManager("publicationPU", "Publication");
51  }
EntityManager createEntityManager(String pu, String conf)
Definition: DaoFactory.java:54
Here is the call graph for this function:

◆ getFactory()

EntityManagerFactory org.turro.publication.db.PublicationPU.getFactory ( )
protected

Reimplemented from org.turro.jpa.Dao.

Definition at line 44 of file PublicationPU.java.

44  {
45  return factory.getEmf();
46  }
EntityManagerFactory getEmf()
Definition: DaoFactory.java:89
Here is the call graph for this function:

◆ getModule()

static Module org.turro.publication.db.PublicationPU.getModule ( )
static

Definition at line 83 of file PublicationPU.java.

83  {
84  return new Module(new Version("1.5.0"), "BrightSide Publication");
85  }

◆ getObjectExtendedPath()

static String org.turro.publication.db.PublicationPU.getObjectExtendedPath ( Object  object)
static

Definition at line 76 of file PublicationPU.java.

76  {
77  if(object instanceof Publication) {
78  return getObjectPath(((Publication) object).getPublicationCategory());
79  }
80  return "";
81  }
static String getObjectPath(Object object)
Here is the call graph for this function:

◆ getObjectPath()

static String org.turro.publication.db.PublicationPU.getObjectPath ( Object  object)
static

Definition at line 63 of file PublicationPU.java.

63  {
64  if(object instanceof Publication) {
65  return "/publication/" + ((Publication) object).getId();
66  } else if(object instanceof PublicationCategory) {
67  return "/pub-category/" + ((PublicationCategory) object).getId();
68  } else if(object instanceof Newsletter) {
69  return "/newsletter/" + ((Newsletter) object).getId();
70  } else if(object instanceof NotificationCategory) {
71  return "/mail-category/" + ((NotificationCategory) object).getIdCategory();
72  }
73  return null;
74  }
Here is the caller graph for this function:

◆ getPath()

String org.turro.publication.db.PublicationPU.getPath ( Object  object)

Reimplemented from org.turro.jpa.Dao.

Definition at line 59 of file PublicationPU.java.

59  {
60  return getObjectPath(object);
61  }
Here is the call graph for this function:

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