fr.paris.lutece.plugins.pluginwizard.business.model
Class AttributeDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.pluginwizard.business.model.AttributeDAO
All Implemented Interfaces:
IAttributeDAO

public final class AttributeDAO
extends java.lang.Object
implements IAttributeDAO

Author:
nobaudv

Constructor Summary
AttributeDAO()
           
 
Method Summary
 void delete(int nAttributeId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a record from the table
 void deleteAllAttributesByPluginId(int nIdPlugin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes all the attribute related to a plugin
 void deleteDependency(int nIdAttribute, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete the dependency
 java.lang.String getTypeName(int nIdAttribute, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Fetches the type name of an attribute
 void insert(int nBusinessId, Attribute attribute, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new record in the table.
 void insertDependency(int nBusinessClassId, int nAttributeId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Inserts the dependency between the business class and the attributes
 Attribute load(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of the attribute from the table
 int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Generates a new primary key
 fr.paris.lutece.util.ReferenceList selectAttributeListCombo(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of types of the attribute for the business class
 java.util.List<Attribute> selectAttributesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of all the attributes and returns them as a List
 java.lang.String selectClassDescription(int nIdBusinessClass, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the string representation of a class
 java.lang.String selectPrimaryKey(int nIdBusinessClass, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Fetches the primary key of a business class
 void store(Attribute attribute, 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

AttributeDAO

public AttributeDAO()
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(int nBusinessId,
                   Attribute attribute,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new record in the table.

Specified by:
insert in interface IAttributeDAO
Parameters:
nBusinessId - The id of the business class
attribute - instance of the Attribute object to insert
plugin - The plugin

insertDependency

public void insertDependency(int nBusinessClassId,
                             int nAttributeId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Inserts the dependency between the business class and the attributes

Parameters:
nBusinessClassId - The business class id
nAttributeId - The attribute identifier
plugin - The plugin

load

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

Specified by:
load in interface IAttributeDAO
Parameters:
nId - The identifier of the attribute
plugin - The plugin
Returns:
the instance of the Attribute

delete

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

Specified by:
delete in interface IAttributeDAO
Parameters:
nAttributeId - The identifier of the attribute
plugin - The plugin

deleteDependency

public void deleteDependency(int nIdAttribute,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete the dependency

Parameters:
nIdAttribute - The identifier of the attribute
plugin - The plugin

store

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

Specified by:
store in interface IAttributeDAO
Parameters:
attribute - The reference of the attribute
plugin - The plugin

selectAttributesList

public java.util.List<Attribute> selectAttributesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of all the attributes and returns them as a List

Specified by:
selectAttributesList in interface IAttributeDAO
Parameters:
plugin - The plugin
Returns:
The List which contains the data of all the attributes

getTypeName

public java.lang.String getTypeName(int nIdAttribute,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Fetches the type name of an attribute

Specified by:
getTypeName in interface IAttributeDAO
Parameters:
nIdAttribute - The id of the attribute
plugin - The plugin
Returns:
The attribute type name

selectAttributeListCombo

public fr.paris.lutece.util.ReferenceList selectAttributeListCombo(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of types of the attribute for the business class

Specified by:
selectAttributeListCombo in interface IAttributeDAO
Parameters:
plugin - The plugin
Returns:
The Collection of the attribute types

deleteAllAttributesByPluginId

public void deleteAllAttributesByPluginId(int nIdPlugin,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deletes all the attribute related to a plugin

Specified by:
deleteAllAttributesByPluginId in interface IAttributeDAO
Parameters:
nIdPlugin - The id of the plugin
plugin - The plugin

selectClassDescription

public java.lang.String selectClassDescription(int nIdBusinessClass,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns the string representation of a class

Specified by:
selectClassDescription in interface IAttributeDAO
Parameters:
nIdBusinessClass - The id of the business class
plugin - The plugin
Returns:
The business class description

selectPrimaryKey

public java.lang.String selectPrimaryKey(int nIdBusinessClass,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Fetches the primary key of a business class

Specified by:
selectPrimaryKey in interface IAttributeDAO
Parameters:
nIdBusinessClass - The id of the business class
plugin - The plugin
Returns:
The string representation of the key of the business class


Copyright © 2011 Mairie de Paris. All Rights Reserved.