fr.paris.lutece.plugins.shorturl.business
Class ShortUrlDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.shorturl.business.ShortUrlDAO
All Implemented Interfaces:
IShortUrlDAO

public final class ShortUrlDAO
extends java.lang.Object
implements IShortUrlDAO

This class provides Data Access methods for ShortUrl objects


Constructor Summary
ShortUrlDAO()
           
 
Method Summary
 void delete(int nShortenerId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void insert(ShortUrl shortUrl, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 ShortUrl load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of the shortener from the table
 ShortUrl load(java.lang.String strKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
           
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 java.util.Collection<ShortUrl> selectShortenersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the shorteners and returns them as a collection
 void store(ShortUrl shortUrl, 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

ShortUrlDAO

public ShortUrlDAO()
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(ShortUrl shortUrl,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IShortUrlDAO
Parameters:
shorturl - instance of the ShortUrl object to insert
plugin - The plugin

load

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

Specified by:
load in interface IShortUrlDAO
Parameters:
nId - The identifier of the shortener
plugin - The plugin
Returns:
the instance of the ShortUrl

delete

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

Specified by:
delete in interface IShortUrlDAO
Parameters:
nShortenerId - The identifier of the shortener
plugin - The plugin

store

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

Specified by:
store in interface IShortUrlDAO
Parameters:
shortUrl - The reference of the shortener
plugin - The plugin

selectShortenersList

public java.util.Collection<ShortUrl> selectShortenersList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the shorteners and returns them as a collection

Specified by:
selectShortenersList in interface IShortUrlDAO
Parameters:
plugin - The plugin
Returns:
The Collection which contains the data of all the shorteners

load

public ShortUrl load(java.lang.String strKey,
                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Specified by:
load in interface IShortUrlDAO
Returns:


Copyright © 2012 Mairie de Paris. All Rights Reserved.