|
||||||||||
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
class NonCachingPersistenceManager
Implementation of persistence manager interface, talking with Hibernate. This implementation
is not 100% usable becase it isn't confirming to the rule of using the same instances. This
means that each time it looks for object (for example, using method getGroups()
)
it returns new instances of group objects (group1 != group2
, but
group1.getId() == group2.getId()
). Persistence Manager implementation should
operate with the same instances all the way and it's carefully checked by acceptance test.
There's another implementation wrapping this one -- PersistenceManager
. It
conforms to the rule.
PersistenceManager
Constructor Summary | |
---|---|
NonCachingPersistenceManager()
|
Method Summary | |
---|---|
void |
addChannelToGroup(ChannelIF channel,
ChannelGroupIF group)
Adds channel to the group . |
ChannelIF |
createChannel(String title,
URL location)
Creates new channel object and persists it into storage. |
ChannelGroupIF |
createGroup(String title)
Creates new group of channels in persistent storage. |
ItemIF |
createItem(ChannelIF channel,
ItemIF ethalon)
Creates new item using specified object as ethalon. |
ItemIF |
createItem(ChannelIF channel,
String title)
Creates new item in the channel. |
void |
deleteChannel(ChannelIF channel)
Deletes channel from persistent storage. |
void |
deleteGroup(ChannelGroupIF group)
Deletes group from persistent storage. |
void |
deleteItem(ItemIF item)
Deletes the item from the 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. |
void |
removeChannelFromGroup(ChannelIF channel,
ChannelGroupIF group)
Deletes channel from the group . |
void |
updateChannel(ChannelIF channel)
Updates data in database with data from channel object. |
void |
updateGroup(ChannelGroupIF group)
Updates data in storage with data from the group object. |
void |
updateItem(ItemIF item)
Updates data in database with data from item object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
NonCachingPersistenceManager()
Method Detail |
---|
public ChannelGroupIF createGroup(String title) throws PersistenceManagerException
createGroup
in interface PersistenceManagerIF
title
- title of the group.
PersistenceManagerException
- in case of any problems.public void updateGroup(ChannelGroupIF group) throws PersistenceManagerException
updateGroup
in interface PersistenceManagerIF
group
- group object
PersistenceManagerException
- in case of any problems.public void deleteGroup(ChannelGroupIF group) throws PersistenceManagerException
deleteGroup
in interface PersistenceManagerIF
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
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
PersistenceManagerException
- in case of any problems.public ChannelIF createChannel(String title, URL location) throws PersistenceManagerException
createChannel
in interface PersistenceManagerIF
title
- title of the channel.location
- location of channel data resource.
PersistenceManagerException
- in case of any problems.public void updateChannel(ChannelIF channel) throws PersistenceManagerException
updateChannel
in interface PersistenceManagerIF
channel
- channel object.
PersistenceManagerException
- in case of any problems.public void addChannelToGroup(ChannelIF channel, ChannelGroupIF group) throws PersistenceManagerException
channel
to the group
.
addChannelToGroup
in interface PersistenceManagerIF
channel
- channel to add.group
- group to use.
PersistenceManagerException
- in case of any problems.public void removeChannelFromGroup(ChannelIF channel, ChannelGroupIF group) throws PersistenceManagerException
channel
from the group
.
This method doesn't delete channel from persistent storage. It only
breaks the association between channel and group.
removeChannelFromGroup
in interface PersistenceManagerIF
channel
- channel to delete.group
- group to use.
PersistenceManagerException
- in case of any problems.public void deleteChannel(ChannelIF channel) throws PersistenceManagerException
deleteChannel
in interface PersistenceManagerIF
channel
- channel to delete.
PersistenceManagerException
- in case of any problems.public ItemIF createItem(ChannelIF channel, String title) throws PersistenceManagerException
createItem
in interface PersistenceManagerIF
channel
- channel to put new item into.title
- title of new item.
PersistenceManagerException
- in case of any problems.public ItemIF createItem(ChannelIF channel, ItemIF ethalon) throws PersistenceManagerException
createItem
in interface PersistenceManagerIF
channel
- channel to put new item into.ethalon
- object to copy properties values from.
PersistenceManagerException
- in case of any problems.public void updateItem(ItemIF item) throws PersistenceManagerException
updateItem
in interface PersistenceManagerIF
item
- item object.
PersistenceManagerException
- in case of any errors.public void deleteItem(ItemIF item) throws PersistenceManagerException
deleteItem
in interface PersistenceManagerIF
item
- item to delete.
PersistenceManagerException
- in case of any problems.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |