Bonjour,

J'ai une View qui marche très bien sous Oracle:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE OR REPLACE FORCE VIEW  "STOCK_TPE" ("nbr", "ID_COMMERCANT", "NOM_COM", "LIB_MAGASIN", "ID_TPE", "LIB_TPE", "ID_OPERATEUR", "LIB_OPERATEUR", "ID_TYPE_CARTE", "LIB_TYPE_CARTE", "STATUS") AS 
  select  count(t.id_type_carte) as "nbr",t.id_commercant, c.nom_com,m.lib_magasin, t.id_tpe, e.lib_tpe,t.id_operateur,o.lib_operateur,t.id_type_carte, tc.lib_type_carte, t.status
 
from
        tables_cles t   ,   type_carte tc   ,
        operateur o     ,   tpe e           , commercant c , magasin m
where
    t.id_operateur=o.id_operateur and
    t.id_type_carte=tc.id_type_carte and
    t.id_commercant=c.id_commercant and
    t.id_tpe=e.id_tpe  and
    e.id_magasin=m.id_magasin and
    t.status in (5,6)
 
GROUP BY t.id_commercant, c.nom_com, m.lib_magasin, t.id_tpe, e.lib_tpe,t.id_operateur,o.lib_operateur,t.id_type_carte, tc.lib_type_carte, t.status;
Le problème est lorsque je veux exécuter cette view avec criteria Hibernate.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
    Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
    Criteria crit = session.createCriteria(StockTpe.class);
    return crit.list();
Je reçois cette erreur :
[WARN,JDBCExceptionReporter,http-8080-2] SQL Error: 904, SQLState: 42000
[ERROR,JDBCExceptionReporter,http-8080-2] ORA-00904: "THIS_"."NBR" : identificateur non valide
Quelqu'un saurait-il m'expliquer d'où peut venir le problème ?

Merci pour votre aide.