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

Persistence manager (database manipulator) More...

Inheritance diagram for cz.vutbr.fit.knot.annotations.app.PersistM:
Inheritance graph
Collaboration diagram for cz.vutbr.fit.knot.annotations.app.PersistM:
Collaboration graph

Public Member Functions

 PersistM ()
 
EntityManager getEM ()
 
Object getEntityById (String entityName, int id)
 
List getEntitiesByName (String entityName)
 
List queryDB (String queryName)
 
List queryDB (String queryName, Object[] params)
 
boolean persistEntity (Object entity)
 
boolean persistEntities (ArrayList< Object > entity)
 
Object saveEntityChanges (Object entity)
 
boolean removeEntity (Object entity)
 
boolean deleteTable (String tableName)
 

Private Attributes

EntityManagerFactory entityManagerFactory
 

Detailed Description

Persistence manager (database manipulator)

Persistence manager (class for manipulating with database)

Author
idytrych

Definition at line 35 of file PersistM.java.

Constructor & Destructor Documentation

cz.vutbr.fit.knot.annotations.app.PersistM.PersistM ( )

Constructor.

Definition at line 42 of file PersistM.java.

Member Function Documentation

boolean cz.vutbr.fit.knot.annotations.app.PersistM.deleteTable ( String  tableName)

Removes all entities from database table

Parameters
tableNameName of table
Returns
In case of error returns true, false otherwise

Definition at line 291 of file PersistM.java.

Here is the call graph for this function:

EntityManager cz.vutbr.fit.knot.annotations.app.PersistM.getEM ( )

Gets entity manager.

Returns
entity manager

Definition at line 51 of file PersistM.java.

Here is the caller graph for this function:

List cz.vutbr.fit.knot.annotations.app.PersistM.getEntitiesByName ( String  entityName)

Gets list of entities with given name from the database

Parameters
entityNameName of entities
Returns
If succeed, returns list of entities, else returns null

Definition at line 88 of file PersistM.java.

Here is the call graph for this function:

Object cz.vutbr.fit.knot.annotations.app.PersistM.getEntityById ( String  entityName,
int  id 
)

Gets entity from the database

Parameters
entityNameName of entity
idId of entity
Returns
If entity was found, returns requested entity, else returns null

Definition at line 62 of file PersistM.java.

Here is the call graph for this function:

boolean cz.vutbr.fit.knot.annotations.app.PersistM.persistEntities ( ArrayList< Object >  entity)

Persist list of entities in to database

Parameters
entitylist of entities to be saved
Returns
In case of error returns true, false otherwise

Definition at line 189 of file PersistM.java.

Here is the call graph for this function:

boolean cz.vutbr.fit.knot.annotations.app.PersistM.persistEntity ( Object  entity)

Persist entity in database

Parameters
entityEntity to be saved
Returns
In case of error returns true, false otherwise

Definition at line 158 of file PersistM.java.

Here is the call graph for this function:

List cz.vutbr.fit.knot.annotations.app.PersistM.queryDB ( String  queryName)

Query database with named query

Parameters
queryNameName of query
Returns
If succeed, returns list of results, else returns null

Definition at line 110 of file PersistM.java.

Here is the call graph for this function:

List cz.vutbr.fit.knot.annotations.app.PersistM.queryDB ( String  queryName,
Object[]  params 
)

Query database with named query with parameters

Parameters
queryNameName of query
paramsArray of parameters
Returns
If succeed, returns list of results, else returns null

Definition at line 133 of file PersistM.java.

Here is the call graph for this function:

boolean cz.vutbr.fit.knot.annotations.app.PersistM.removeEntity ( Object  entity)

Removes entity from database

Parameters
entityEntity to be removed
Returns
In case of error returns true, false otherwise

Definition at line 261 of file PersistM.java.

Here is the call graph for this function:

Object cz.vutbr.fit.knot.annotations.app.PersistM.saveEntityChanges ( Object  entity)

Saves changes in entity to database

Parameters
entityEntity to be saved
Returns
In case of failure returns null, saved entity otherwise

Definition at line 232 of file PersistM.java.

Here is the call graph for this function:

Member Data Documentation

EntityManagerFactory cz.vutbr.fit.knot.annotations.app.PersistM.entityManagerFactory
private

Definition at line 37 of file PersistM.java.


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