fr.paris.lutece.plugins.wiki.business
Class TopicVersionDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.wiki.business.TopicVersionDAO
All Implemented Interfaces:
ITopicVersionDAO

public final class TopicVersionDAO
extends Object
implements ITopicVersionDAO

This class provides Data Access methods for TopicVersion objects


Constructor Summary
TopicVersionDAO()
           
 
Method Summary
 void delete(int nTopicVersionId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteByTopic(int nTopicId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove all topicVersions for a given topic
 void insert(TopicVersion topicVersion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 TopicVersion load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data from the table
 Collection<TopicVersion> loadAllVersions(int nIdTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load all versions
 TopicVersion loadLastVersion(int nIdTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load last version
 void modifyTopicVersion(int nTopicId, String strUserName, String strComment, String strContent, int nPreviousVersion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Modify the topic version
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 Collection<TopicVersion> selectTopicVersionsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the topicVersion objects and returns them as a collection
 void store(TopicVersion topicVersion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the record in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicVersionDAO

public TopicVersionDAO()
Method Detail

newPrimaryKey

public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Generates a new primary key

Parameters:
plugin - The Plugin
Returns:
The new primary key

insert

public void insert(TopicVersion topicVersion,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface ITopicVersionDAO
Parameters:
topicVersion - instance of the TopicVersion object to inssert
plugin - the Plugin

load

public TopicVersion load(int nId,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data from the table

Specified by:
load in interface ITopicVersionDAO
Parameters:
nId - The key
plugin - the Plugin
Returns:
The instance of the topicVersion

delete

public void delete(int nTopicVersionId,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a record from the table

Specified by:
delete in interface ITopicVersionDAO
Parameters:
nTopicVersionId - int identifier of the TopicVersion to delete
plugin - the Plugin

deleteByTopic

public void deleteByTopic(int nTopicId,
                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove all topicVersions for a given topic

Specified by:
deleteByTopic in interface ITopicVersionDAO
Parameters:
nTopicId - The Topic Id
plugin - the Plugin

store

public void store(TopicVersion topicVersion,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the record in the table

Specified by:
store in interface ITopicVersionDAO
Parameters:
topicVersion - the reference of the TopicVersion
plugin - the Plugin

selectTopicVersionsList

public Collection<TopicVersion> selectTopicVersionsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the topicVersion objects and returns them as a collection

Specified by:
selectTopicVersionsList in interface ITopicVersionDAO
Parameters:
plugin - the Plugin
Returns:
The collection which contains the data of all the topicVersion objects

modifyTopicVersion

public void modifyTopicVersion(int nTopicId,
                               String strUserName,
                               String strComment,
                               String strContent,
                               int nPreviousVersion,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Modify the topic version

Specified by:
modifyTopicVersion in interface ITopicVersionDAO
Parameters:
nTopicId - The topic ID
strUserName - The username
strComment - The comment
strContent - The content
nPreviousVersion - The previous version
plugin - The plugin

loadLastVersion

public TopicVersion loadLastVersion(int nIdTopic,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load last version

Specified by:
loadLastVersion in interface ITopicVersionDAO
Parameters:
nIdTopic - The topic ID
plugin - The plugin
Returns:
The topic version

loadAllVersions

public Collection<TopicVersion> loadAllVersions(int nIdTopic,
                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load all versions

Specified by:
loadAllVersions in interface ITopicVersionDAO
Parameters:
nIdTopic - The topic id
plugin - The plugin
Returns:
The list of topics


Copyright © 2014 Mairie de Paris. All Rights Reserved.