|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.utils.manager.hibernate.NonCachingPersistenceManager de.nava.informa.utils.manager.hibernate.PersistenceManager
public class PersistenceManager
Hibernate Persistence Manager. This manager talks to Hibernate to store / restore
persistence data. Manager is multi-thread safe. It follows the rule of identities and
multiple calls to getting methods (for example, getGroups()
) return
the same instances of objects. This makes life of developers and client applications
easier.
It's not enough to directly update the fields of objects in order to have the same
fields updated persistently. You should explicitly call updateXXXX()
methods to transfer changes to the storage. The decision to make explicit updates
based on the fact that automatic flushing changes to database each time the value
of some property changes will take too much resources when many properties are
updated in a single block of code.
Note that the manager itself does no efforts to initialize Hibernate!
It uses system properties as overrides of normal Hibernate inialization ways, like
hibernate.properties
and hibernate.cfg.xml
files which
are loaded when this manager requires Hibernate services for the first time. Please,
read Hibernate documentation to learn what files and where should be placed
to initialize the product properly.
Please also note, that this implementation requires to be the only source of changes to Hibernate data storage (database or something else) to operate normally! Basically it is not a problem at all, but if you find that it's not your case, please let us know.
Constructor Summary | |
---|---|
PersistenceManager()
|
Method Summary | |
---|---|
ChannelGroupIF |
createGroup(String title)
Creates new group of channels in persistent storage. |
void |
deleteGroup(ChannelGroupIF group)
Deletes group from persistent storage. |
ChannelGroupIF[] |
getGroups()
Returns the list of groups available in database. |
void |
mergeGroups(ChannelGroupIF first,
ChannelGroupIF second)
Takes channels from the second group and put them all in first
group. |
Methods inherited from class de.nava.informa.utils.manager.hibernate.NonCachingPersistenceManager |
---|
addChannelToGroup, createChannel, createItem, createItem, deleteChannel, deleteItem, removeChannelFromGroup, updateChannel, updateGroup, updateItem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistenceManager()
Method Detail |
---|
public ChannelGroupIF createGroup(String title) throws PersistenceManagerException
createGroup
in interface PersistenceManagerIF
createGroup
in class NonCachingPersistenceManager
title
- title of the group.
PersistenceManagerException
- in case of any problems.public void deleteGroup(ChannelGroupIF group) throws PersistenceManagerException
deleteGroup
in interface PersistenceManagerIF
deleteGroup
in class NonCachingPersistenceManager
group
- group to delete.
PersistenceManagerException
- in case of any problems.public void mergeGroups(ChannelGroupIF first, ChannelGroupIF second) throws PersistenceManagerException
second
group and put them all in first
group. Then second
group is deleted.
mergeGroups
in interface PersistenceManagerIF
mergeGroups
in class NonCachingPersistenceManager
first
- first group of channels.second
- second group of channels.
PersistenceManagerException
- in case of any problems.public ChannelGroupIF[] getGroups() throws PersistenceManagerException
getGroups
in interface PersistenceManagerIF
getGroups
in class NonCachingPersistenceManager
PersistenceManagerException
- in case of any problems.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |