fr.paris.lutece.plugins.pluginwizard.business
Class ModelHome

java.lang.Object
  extended by fr.paris.lutece.plugins.pluginwizard.business.ModelHome

public final class ModelHome
extends Object

This class provides instances management methods (create, find, ...) for Model objects


Method Summary
static Model create(Model model)
          Create an instance of the model class
static int exists(String strPluginName)
          Check if a plugin already exists
static Model findByPrimaryKey(int nKey)
          Returns an instance of a model whose identifier is specified in parameter
static void remove(int nModelId)
          Remove the model whose identifier is specified in parameter
static Model update(Model model)
          Update of the model which is specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

exists

public static int exists(String strPluginName)
Check if a plugin already exists

Parameters:
strPluginName - The plugin name
Returns:
-1 if not exists, otherwise the plugin id

create

public static Model create(Model model)
Create an instance of the model class

Parameters:
model - The instance of the Model which contains the informations to store
Returns:
The instance of model which has been created with its primary key.

update

public static Model update(Model model)
Update of the model which is specified in parameter

Parameters:
model - The instance of the Model which contains the data to store
Returns:
The instance of the model which has been updated

remove

public static void remove(int nModelId)
Remove the model whose identifier is specified in parameter

Parameters:
nModelId - The model Id

findByPrimaryKey

public static Model findByPrimaryKey(int nKey)
Returns an instance of a model whose identifier is specified in parameter

Parameters:
nKey - The model primary key
Returns:
an instance of Model


Copyright © 2013 Mairie de Paris. All Rights Reserved.