org.orange.kicsa.integration.admin
Class OwnerJDBCDAO

org.orange.util.integration.JDBCDAO
  |
  +--org.orange.kicsa.integration.admin.OwnerJDBCDAO

public class OwnerJDBCDAO
extends JDBCDAO
implements OwnerDAO

Author:
Jérôme Beau pour Orange (c) 2002
Version: $Revision: 1.1.1.1 $
Stereotype singleton
testcase <{test.org.orange.kicsa.integration.skill.TestSkillJDBCDAO}>

Field Summary
 final static StringEMPLOYEE_KEY
           
 final static StringINSERT
          Insère une nouvelle compétence
 final static StringREMOVE
           
 final static StringREMOVE_BY_EMPLOYEE
           
 final static StringREMOVE_BY_SKILL
           
 final static StringSELECT_OWNERS_BY_SKILL
           
 final static StringSELECT_SKILLS_BY_OWNER
           
 final static StringSKILL_KEY
           
 final static StringTABLE
           

Fields inherited from class org.orange.util.integration.JDBCDAO
AND, CONNECTION_FACTORY_CLASS_NAME, CONNECTION_FACTORY_CLASS_NAME_DEFAULT, DELETE_FROM, DISTINCT, EQUAL_PARAMETER, FROM, IN, INSERT_INTO, LIKE, NOT, OR, ORDER_BY, SELECT, SET, UPDATE, VALUES, WHERE

Method Summary
 voidcreate(SkillKey someSkill, EmployeeKey someEmployee)
          Enregistre une nouveau propriétaire de compétence
 static OwnerDAOgetInstance()
          Recherche les compétences racines (sans relations parent)

public final static String SELECT_ROOTS = SELECT + " distinct " + ALL_FIELDS + FROM + TABLE + " LEFT JOIN "
+ TABLE + " ON " + TABLE + "."
 CollectiongetOwnersBySkill(SkillKey someSkill)
           
 CollectiongetSkillsByOwner(EmployeeKey someEmployee)
          Get skills for a owner
 booleanisCacheEnabled()
           
 voidremove(SkillKey someSkill, EmployeeKey someEmployee)
          Supprime un enregistrement de compétence
 intremoveByEmployee(EmployeeKey someEmployee)
           
 intremoveBySkill(SkillKey someSkill)
           
 voidsetCacheEnabled(boolean someEnabledState)
           

Methods inherited from class org.orange.util.integration.JDBCDAO
getConnection

Field Detail

EMPLOYEE_KEY

public final static String EMPLOYEE_KEY

INSERT

public final static String INSERT
Insère une nouvelle compétence

REMOVE

public final static String REMOVE

REMOVE_BY_EMPLOYEE

public final static String REMOVE_BY_EMPLOYEE

REMOVE_BY_SKILL

public final static String REMOVE_BY_SKILL

SELECT_OWNERS_BY_SKILL

public final static String SELECT_OWNERS_BY_SKILL

SELECT_SKILLS_BY_OWNER

public final static String SELECT_SKILLS_BY_OWNER

SKILL_KEY

public final static String SKILL_KEY

TABLE

public final static String TABLE
Method Detail

create

public void create(SkillKey someSkill, EmployeeKey someEmployee)
throws org.orange.util.integration.DAOException
Enregistre une nouveau propriétaire de compétence
Parameters:
someSkill La compétence à enregistrer
Returns: La compétence enregistrée, avec sa clé générée (sauf si la clé est celle de la compétence racine)

getInstance

public static OwnerDAO getInstance()
throws org.orange.util.integration.DAOException
Recherche les compétences racines (sans relations parent)

public final static String SELECT_ROOTS = SELECT + " distinct " + ALL_FIELDS + FROM + TABLE + " LEFT JOIN "
+ TABLE + " ON " + TABLE + "." + KEY + "=" + ID_FROM
+ WHERE + ID_FROM + " IS NULL";

/** /
public Collection getRoots() throws DAOException
{
log.debug ("getRoots");

if (roots.size() == 0)
try
{
Connection connection = getConnection();
try
{
PreparedStatement selectAllStatement = connection.prepareStatement (SELECT_ROOTS);
ResultSet rootsResultSet = selectAllStatement.executeQuery();
while (rootsResultSet.next())
{
Skill skill = rowToObject (null, rootsResultSet);
roots.add (skill);
}
}
finally
{
connection.close();
}
}
catch (SQLException sqlProblem)
{
throw new DAOException("Impossible de récupérer les compétences racines", sqlProblem);
}
return roots;
}

/**
Returns: Le singleton

getOwnersBySkill

public Collection getOwnersBySkill(SkillKey someSkill)
throws org.orange.util.integration.DAOException,
org.orange.kicsa.SkillNotFoundException

getSkillsByOwner

public Collection getSkillsByOwner(EmployeeKey someEmployee)
throws org.orange.util.integration.DAOException,
org.orange.kicsa.EmployeeNotFoundException
Get skills for a owner

isCacheEnabled

public boolean isCacheEnabled()

remove

public void remove(SkillKey someSkill, EmployeeKey someEmployee)
throws org.orange.util.integration.DAOException
Supprime un enregistrement de compétence
Parameters:
someSkillKey La clé de la compétence à supprimer

removeByEmployee

public int removeByEmployee(EmployeeKey someEmployee)
throws org.orange.util.integration.DAOException,
org.orange.kicsa.EmployeeNotFoundException

removeBySkill

public int removeBySkill(SkillKey someSkill)
throws org.orange.util.integration.DAOException,
org.orange.kicsa.SkillNotFoundException

setCacheEnabled

public void setCacheEnabled(boolean someEnabledState)
throws org.orange.util.integration.DAOException

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

Insère une nouvelle compétence

to Class java.lang.String

to Class java.lang.String

to Class org.orange.kicsa.integration.admin.OwnerJDBCDAO

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

Dependency Links

to Class test.org.orange.kicsa.integration.skill.TestSkillJDBCDAO

to Class org.orange.util.integration.JDBCDAO

to Class org.orange.kicsa.integration.admin.OwnerDAO

to Class java.lang.String

to Class org.orange.util.integration.DAOException

to Class org.orange.kicsa.business.skill.SkillKey

to Class org.orange.kicsa.business.employee.EmployeeKey

to Class java.sql.Connection

to Class java.sql.PreparedStatement

to Class java.sql.SQLException

to Class java.lang.Throwable

to Class java.util.Collection

to Class org.orange.kicsa.EmployeeNotFoundException

to Class org.orange.util.Assert

to Class java.sql.ResultSet

to Class java.util.ArrayList

to Class java.lang.Class

to Class org.orange.kicsa.SkillNotFoundException

to Class Diagram test.org.orange.kicsa.integration.skill

to Class Diagram test.org.orange.kicsa.integration

to Class Diagram test.org.orange.kicsa

to Class Diagram test.org.orange

to Class Diagram test.org

to Class Diagram test

to Class Diagram <default>

to Class Diagram org.orange.util.integration

to Class Diagram org.orange.util

to Class Diagram org.orange

to Class Diagram org

to Class Diagram org.orange.kicsa.integration.admin

to Class Diagram org.orange.kicsa.integration

to Class Diagram org.orange.kicsa

to Class Diagram org.orange.kicsa.business.skill

to Class Diagram org.orange.kicsa.business

to Class Diagram org.orange.kicsa.business.employee