|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.dico.islab.idbs2.cloud.session.CloudSessionManager
public class CloudSessionManager
Class for Hibernate Session automatic management. This class offers only static methods,
usually protected
, for Hibernate session management which are used from other
classes of this package.
N.B.: All the operations executed through manager classes will be exectued referring to this class's internal session
Field Summary | |
---|---|
static CloudEdgeManager |
cem
CloudEdgeManager reference, used to manage CloudEdge objects. |
static CloudManager |
cm
CloudManager reference, used to manage Cloud objects. |
static CloudNodeManager |
cnm
CloudNodeManager reference, used to manage CloudNode objects. |
Method Summary | |
---|---|
static void |
beginTransaction()
Start a new transaction for the internal Session. |
protected static void |
checkActiveTransaction()
Check if the internal session has an active transaction, otherwise creates automatically a new transaction warning the user. |
static void |
commitTransaction()
Commit the internal session active transaction. |
protected static org.hibernate.Session |
getInternalSession()
|
static org.hibernate.SessionFactory |
getSessionFactory()
Returns an Hibernate Session Factory created for this kc model. |
static org.hibernate.SessionFactory |
getSessionFactory(File conf)
Same as getSessionFactory() . |
protected static void |
saveOrUpdateObject(Object obj)
Give persistence (on relational database) to an object mapped with Hibernate using the internal Session Factory of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static CloudManager cm
CloudManager
reference, used to manage Cloud
objects.
public static CloudNodeManager cnm
CloudNodeManager
reference, used to manage CloudNode
objects.
public static CloudEdgeManager cem
CloudEdgeManager
reference, used to manage CloudEdge
objects.
Method Detail |
---|
protected static void saveOrUpdateObject(Object obj)
Give persistence (on relational database) to an object mapped with Hibernate using the
internal Session Factory
of this class.
This method is defined only in this class (as it is the main class of this package) and is called by every
saveOrUpdate
method of other classes of this package.
obj
- The Hibernate mapped object to be persisted.protected static void checkActiveTransaction()
public static void beginTransaction()
public static void commitTransaction()
public static org.hibernate.SessionFactory getSessionFactory()
Returns an Hibernate Session Factory created for this kc model. This Session Factory will be different
at any call of this method and is different from the internal Session Factory used by other methods
(e.g. saveOrUpdate and getKnowledgeChunkById
).
This session factory is created using the config/kcDatabaseConfiguration.xml
file.
SessionFactory
public static org.hibernate.SessionFactory getSessionFactory(File conf)
getSessionFactory()
. Only difference is that the configuration file
the SessionFactory will be built upon is passed as argument. This method can be used to obtain new
SessionFactories for databases different from the standard one.
conf
- the configuration file in a standard xml Hibernate version.
protected static org.hibernate.Session getInternalSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |