4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.comet.Persister Class Reference

Static class which persists data to the database. More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.comet.Persister:
Collaboration graph

Static Public Member Functions

static boolean persist (RequestInfo requestInfo)
 
static void setUriOfAnnotationsParams (Annotation annot)
 
static void updateAnnot (EntityManager em, Annotation annotation, RequestInfo requestInfo) throws RuntimeException
 
static boolean persistAUpdAnnot (RequestInfo requestInfo)
 

Static Private Member Functions

static AnnotType queryType (String uri, EntityManager em) throws RuntimeException
 
static void updateTypesInNested (Annotation annotation, EntityManager em)
 
static Annotation saveTmpIdRefAnnotations (Annotation annot, RequestInfo requestInfo, EntityManager em) throws RuntimeException
 
static void saveTmpIdRefAnnotationsSolveLinks (RequestInfo requestInfo, EntityManager em, ArrayList< Annotation > justSaved, ArrayList< Annotation > nowSaved, ArrayList< Annotation > nestedBeforeSave, ArrayList< Annotation > nestedAfterSave, HashMap< Annotation, ArrayList< BaseAttribute >> unSavedLinks) throws RuntimeException
 
static Annotation saveTmpIdRefAnnotations (Annotation annot, RequestInfo requestInfo, EntityManager em, ArrayList< Annotation > justSaved, ArrayList< Annotation > nowSaved, ArrayList< Annotation > nested4Links, ArrayList< Annotation > nested4LinksFromDB, HashMap< Annotation, ArrayList< BaseAttribute >> unSavedLinks) throws RuntimeException
 
static void addNewReferenceOnNestedAnnotation (Annotation saved, ArrayList< Annotation > nested4LinksFromDB)
 
static void updateTypes (Annotation annotation, EntityManager em, String logMsg) throws RuntimeException
 
static void updateTmpIdRefInAddedEditedASuggested (String tmpId, Annotation newLink, RequestInfo requestInfo)
 
static void updateTmpIdRefInNested (String tmpId, Annotation nestedAnn, Annotation newLink)
 

Detailed Description

Static class which persists data to the database.

Static class which persists data to the database

Author
idytrych

Definition at line 49 of file Persister.java.

Member Function Documentation

static void cz.vutbr.fit.knot.annotations.comet.Persister.addNewReferenceOnNestedAnnotation ( Annotation  saved,
ArrayList< Annotation nested4LinksFromDB 
)
staticprivate

Add new reference on nested annotations recursively to list

Parameters
savedAnnotation with nested
nested4LinksFromDBList of new references

Definition at line 1032 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.comet.Persister.persist ( RequestInfo  requestInfo)
static

Persist informations from request to the database (it persists derived and related informations too)

Parameters
requestInfoInformations about client request
Returns
If succeed, returns false, in case of error returns true

Definition at line 58 of file Persister.java.

Here is the call graph for this function:

static boolean cz.vutbr.fit.knot.annotations.comet.Persister.persistAUpdAnnot ( RequestInfo  requestInfo)
static

Persist informations about automatically updated annotations

Parameters
requestInfoInformations about client request
Returns
If succeed, returns false, in case of error returns true

Definition at line 717 of file Persister.java.

Here is the call graph for this function:

static AnnotType cz.vutbr.fit.knot.annotations.comet.Persister.queryType ( String  uri,
EntityManager  em 
) throws RuntimeException
staticprivate

Query database for type of annotation

Parameters
uriURI of type of annotation
emEntity manager
Returns
Returns type of annotation with given URI
Exceptions
RuntimeExceptionIf type of annotation was not found, throws exception

Definition at line 689 of file Persister.java.

Here is the caller graph for this function:

static Annotation cz.vutbr.fit.knot.annotations.comet.Persister.saveTmpIdRefAnnotations ( Annotation  annot,
RequestInfo  requestInfo,
EntityManager  em 
) throws RuntimeException
staticprivate

Recursively saves annotations in attributes of given annotation.

Parameters
annotAnnotation for reference update
requestInfoInformations about client request
emcurrent EntityManager
Returns
uri of the new saved annotation
Exceptions
RuntimeException

Definition at line 830 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static Annotation cz.vutbr.fit.knot.annotations.comet.Persister.saveTmpIdRefAnnotations ( Annotation  annot,
RequestInfo  requestInfo,
EntityManager  em,
ArrayList< Annotation justSaved,
ArrayList< Annotation nowSaved,
ArrayList< Annotation nested4Links,
ArrayList< Annotation nested4LinksFromDB,
HashMap< Annotation, ArrayList< BaseAttribute >>  unSavedLinks 
) throws RuntimeException
staticprivate

Recursively saves annotations in attributes of given annotation.

Parameters
annotAnnotation for reference update
requestInfoInformations about client request
emcurrent EntityManager
justSavedList of just saved annotations (versions before saving)
nowSavedList of just saved annotations (really saved versions)
nested4Linkstemporary list for nested annotation links
nested4LinksFromDBtemporary list for saved nested annotation links
unSavedLinksHashMap of arraylist of unsaved links for annotation
Returns
uri of the new saved annotation
Exceptions
RuntimeException

Definition at line 978 of file Persister.java.

Here is the call graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.saveTmpIdRefAnnotationsSolveLinks ( RequestInfo  requestInfo,
EntityManager  em,
ArrayList< Annotation justSaved,
ArrayList< Annotation nowSaved,
ArrayList< Annotation nestedBeforeSave,
ArrayList< Annotation nestedAfterSave,
HashMap< Annotation, ArrayList< BaseAttribute >>  unSavedLinks 
) throws RuntimeException
staticprivate

Updates links in saved annotations

Parameters
requestInfoInformations about client request
emcurrent EntityManager
justSavedList of just saved annotations (versions before saving)
nowSavedList of just saved annotations (really saved versions)
nestedBeforeSaveList of just saved nested annotations (versions before saving)
nestedAfterSaveList of just saved nested annotations (really saved versions)
unSavedLinksHashMap of arraylist of unsaved links for annotation
Exceptions
RuntimeException

Definition at line 874 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.setUriOfAnnotationsParams ( Annotation  annot)
static

Sets uri from value in annotation link parameters of given annotation, also recursively in nested annotations

Parameters
annotGiven annotation

Definition at line 499 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.updateAnnot ( EntityManager  em,
Annotation  annotation,
RequestInfo  requestInfo 
) throws RuntimeException
static

Updates complete informations about annotation in database

Parameters
emEntity manager
annotationUpdated annotation
requestInfoInformations about client request

Definition at line 532 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.updateTmpIdRefInAddedEditedASuggested ( String  tmpId,
Annotation  newLink,
RequestInfo  requestInfo 
)
staticprivate

Updates LinkedAnnotationAttribute references after saving new Annotations to DB

Parameters
tmpIdold tmpId link of Annotation
newLinknew link of Annotation
requestInfoInformations about client request

Definition at line 1102 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.updateTmpIdRefInNested ( String  tmpId,
Annotation  nestedAnn,
Annotation  newLink 
)
staticprivate

Updates NestAnnotationAttribute references after saving new Annotations to DB

Parameters
tmpIdold tmpId link of Annotation
nestedAnnNested Annotation link
newLinknew link of Annotation

Definition at line 1178 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.updateTypes ( Annotation  annotation,
EntityManager  em,
String  logMsg 
) throws RuntimeException
staticprivate

Method updates types in Annotation

Parameters
annotationannotation for update
emcurrent EntityManager
logMsgMessage which should be used for logging.
Exceptions
RuntimeException

Definition at line 1051 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static void cz.vutbr.fit.knot.annotations.comet.Persister.updateTypesInNested ( Annotation  annotation,
EntityManager  em 
)
staticprivate

Updates types in nested annotations (use types stored in DB)

Parameters
annotationAnnotation, which attributes will be updated
emEntity manager

Definition at line 782 of file Persister.java.

Here is the call graph for this function:

Here is the caller graph for this function:


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