Voici mon code :
public static Session currentSession() throws HibernateException
{
Session s = (Session)session.get();
// Ouvre une nouvelle Session, si ce Thread n'en a aucune
if ( s == null )
{
s = sessionFactory.openSession();
session.set( s );
}
return s;
}
Voici le warning :
Type safety: The method set(Object) belongs to the raw type ThreadLocal.
References to generic type ThreadLocal<T> should be parameterized
Quelqu'un pourrait m'expliquer ou me donner les références pour m'instruire
svp ?
Merci d'avance
Lilian
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Xavier MOGHRABI
LR wrote:
Salut,
Voici mon code : public static Session currentSession() throws HibernateException { Session s = (Session)session.get(); // Ouvre une nouvelle Session, si ce Thread n'en a aucune if ( s == null ) { s = sessionFactory.openSession(); session.set( s ); } return s; }
Voici le warning : Type safety: The method set(Object) belongs to the raw type ThreadLocal. References to generic type ThreadLocal<T> should be parameterized
Quelqu'un pourrait m'expliquer ou me donner les références pour m'instruire svp ?
jète un coup d'oeil à ça : http://hibernate.org/42.html
Voici mon code :
public static Session currentSession() throws HibernateException
{
Session s = (Session)session.get();
// Ouvre une nouvelle Session, si ce Thread n'en a aucune
if ( s == null )
{
s = sessionFactory.openSession();
session.set( s );
}
return s;
}
Voici le warning :
Type safety: The method set(Object) belongs to the raw type ThreadLocal.
References to generic type ThreadLocal<T> should be parameterized
Quelqu'un pourrait m'expliquer ou me donner les références pour
m'instruire svp ?
jète un coup d'oeil à ça :
http://hibernate.org/42.html
Voici mon code : public static Session currentSession() throws HibernateException { Session s = (Session)session.get(); // Ouvre une nouvelle Session, si ce Thread n'en a aucune if ( s == null ) { s = sessionFactory.openSession(); session.set( s ); } return s; }
Voici le warning : Type safety: The method set(Object) belongs to the raw type ThreadLocal. References to generic type ThreadLocal<T> should be parameterized
Quelqu'un pourrait m'expliquer ou me donner les références pour m'instruire svp ?
jète un coup d'oeil à ça : http://hibernate.org/42.html