fr.paris.lutece.plugins.unittree.service.sector
Class SectorService

java.lang.Object
  extended by fr.paris.lutece.plugins.unittree.service.sector.SectorService
All Implemented Interfaces:
ISectorService

public class SectorService
extends java.lang.Object
implements ISectorService

SectorService


Constructor Summary
SectorService()
           
 
Method Summary
 void addSectorsToUnit(Unit unit, java.util.List<java.lang.Integer> listIdsSector)
          Add sectors to the unit
 java.util.List<Sector> findAll()
          Find all sectors
 java.util.List<Sector> findByIdUnit(int nIdUnit)
          find a list of sectors from a given id unit
 Sector findByPrimaryKey(int nIdSector)
          Find a sector from its primary key
 java.util.List<java.lang.Integer> getIdsSectorByIdUnit(int nIdUnit)
          Get the ids sector from a given id unit
 boolean hasSector(int nIdUnit, int nIdSector)
          Check if the unit has the sector
 boolean hasSectors(int nIdUnit)
          Check if the unit has sectors
 void removeSector(int nIdUnit, int nIdSector)
          Remove the sectors from an unit
 void removeSectorsFromUnit(int nIdUnit)
          Remove the sectors from an unit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectorService

public SectorService()
Method Detail

findByPrimaryKey

public Sector findByPrimaryKey(int nIdSector)
Find a sector from its primary key

Specified by:
findByPrimaryKey in interface ISectorService
Parameters:
nIdSector - the id sector
Returns:
an instance of Sector

findAll

public java.util.List<Sector> findAll()
Find all sectors

Specified by:
findAll in interface ISectorService
Returns:
a list of Sector

findByIdUnit

public java.util.List<Sector> findByIdUnit(int nIdUnit)
find a list of sectors from a given id unit

Specified by:
findByIdUnit in interface ISectorService
Parameters:
nIdUnit - the id unit
Returns:
a list of Sector

getIdsSectorByIdUnit

public java.util.List<java.lang.Integer> getIdsSectorByIdUnit(int nIdUnit)
Get the ids sector from a given id unit

Specified by:
getIdsSectorByIdUnit in interface ISectorService
Parameters:
nIdUnit - the id unit
Returns:
a list of ids sector

hasSector

public boolean hasSector(int nIdUnit,
                         int nIdSector)
Check if the unit has the sector

Specified by:
hasSector in interface ISectorService
Parameters:
nIdUnit - the id unit
nIdSector - the id sector
Returns:
true if the unit has the sector, false otherwise

hasSectors

public boolean hasSectors(int nIdUnit)
Check if the unit has sectors

Specified by:
hasSectors in interface ISectorService
Parameters:
nIdUnit - the id unit
Returns:
true if the unit has sector, false otherwise

addSectorsToUnit

@Transactional(value="unittree.transactionManager")
public void addSectorsToUnit(Unit unit,
                                           java.util.List<java.lang.Integer> listIdsSector)
Add sectors to the unit

Specified by:
addSectorsToUnit in interface ISectorService
Parameters:
unit - the unit
listIdsSector - the list of ids sector

removeSectorsFromUnit

@Transactional(value="unittree.transactionManager")
public void removeSectorsFromUnit(int nIdUnit)
Remove the sectors from an unit

Specified by:
removeSectorsFromUnit in interface ISectorService
Parameters:
nIdUnit - the id unit

removeSector

public void removeSector(int nIdUnit,
                         int nIdSector)
Remove the sectors from an unit

Specified by:
removeSector in interface ISectorService
Parameters:
nIdUnit - the id unit
nIdSector - the id sector


Copyright © 2012 Mairie de Paris. All Rights Reserved.