IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java EE Discussion :

Erreur de syntaxe avec les requêtes JPQL


Sujet :

Java EE

  1. #1
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut Erreur de syntaxe avec les requêtes JPQL
    Bonjour à tous, je suis en train de développer une application avec ejb/jsf . J'ai une erreur sur une de mes requêtes.
    voila la requête qui pose probleme. Si jamais quelqu'un voit l'erreur je suis preneur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    public List<Livrable> RechercheLivrableParProjet(int idprojet) {
            String  requete ="SELECT l.LivrableName, p.ProjetName, l.DateCRTLivrable, l.DateLivraison, l.Nature, l.type, l.status, v.VersionName"
                    + " FROM  Livrable l ,Projet p, Version_Liv v"
                    + " WHERE  p.ProjetID=l.projets "
                    + "AND  v.VersionLivID=l.Version"
                    + " AND  p.ProjetID= :ProjetID";
            Query  req=em.createQuery(requete);
            req.setParameter("ProjetID",idprojet);
            return req.getResultList();
        }
    au fait j ai trois entité qui sont: livrable, produit et Version_liv
    dont idProduit migre dans la table livrable et idVersion_liv migre dans la Livrable
    voici l erreur que ça me genere:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLSyntaxErrorException: Erreur de syntaxe : Encountered ")" at line 1, column 219.
    Error Code: -1
    Call: SELECT t0.LIVRABLENAME, t1.PROJETNAME, t0.DATECRTLIVRABLE, t0.DATELIVRAISON, t0.NATURE, t0.TYPE, t0.STATUS, t2.VERSIONNAME FROM VERSION_LIV t4, PROJET t3, VERSION_LIV t2, PROJET t1, LIVRABLE t0 WHERE ((((t1.PROJETID = ) AND (t2.VERSIONLIVID = )) AND (t1.PROJETID = ?)) AND ((t3.PROJETID = t0.ProjetID_fk) AND (t4.VERSIONLIVID = t0.VersionLivID_fk)))
    	bind => [1]
    Query: ReportQuery(referenceClass=Livrable sql="SELECT t0.LIVRABLENAME, t1.PROJETNAME, t0.DATECRTLIVRABLE, t0.DATELIVRAISON, t0.NATURE, t0.TYPE, t0.STATUS, t2.VERSIONNAME FROM VERSION_LIV t4, PROJET t3, VERSION_LIV t2, PROJET t1, LIVRABLE t0 WHERE ((((t1.PROJETID = ) AND (t2.VERSIONLIVID = )) AND (t1.PROJETID = ?)) AND ((t3.PROJETID = t0.ProjetID_fk) AND (t4.VERSIONLIVID = t0.VersionLivID_fk)))")
    aidez moi moi franchement je ne voix pas l erreur de syntaxe
    merci d avance

  2. #2
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 70
    Points : 83
    Points
    83
    Par défaut
    Est-ce possible de voir la déclaration des champs projets et Version dans ta classe Livrable ?

  3. #3
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    merci pour ta reponse:
    voici mes entités

    Livrable:
    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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    package com.bean.ModuleExigence.Livrable.entities;
     
    import com.bean.ModuleProjet.User.entitites.*;
    import java.io.Serializable;
    import java.util.Date;
    import java.util.List;
     
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.JoinTable;
    import javax.persistence.ManyToOne;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.OneToMany;
    import javax.persistence.Temporal;
     
    @Entity
    @NamedQueries( {
    @NamedQuery(name = "findAllLivrable", query = "SELECT ct FROM Livrable  ct"),
    @NamedQuery(name="RechercheParProjet",query="SELECT  NEW com.bean.ModuleProjet.User.entitites.GestionRisqueExigence(l.LivrableName, p.ProjetName, l.DateCRTLivrable, l.DateLivraison, l.Nature, l.type, l.status) FROM  Livrable l ,Projet p WHERE  p.ProjetID=l.projets  AND  p.ProjetID= :ProjetID")
    } )
    public class Livrable  implements Serializable{
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	@Id
    	@GeneratedValue(strategy=GenerationType.IDENTITY)  
     
    	private  int  LivrableID;
    	private  String  LivrableName;
    	private  String  LivrableDescription;
        @Temporal(javax.persistence.TemporalType.DATE)
    	private  Date   DateCRTLivrable;
        @Temporal(javax.persistence.TemporalType.DATE)
    	private  Date   DateLivraison;
    	  private  String Nature;
    	   private String type;
    	   private  String status;
    	 @JoinColumn(name="VersionLivID_fk", nullable=false)
    	   @ManyToOne(fetch=FetchType.LAZY)
    	   private  Version_Liv Version;
       @JoinColumn(name="ProjetID_fk", nullable=false)
    	   @ManyToOne(fetch=FetchType.LAZY)
               private  Projet projets;
              @OneToMany(mappedBy ="livra")
    	  private List<Historique_Liv> LivHistory;
     
    	 @OneToMany
    		@JoinTable(name="Projet_Livrable", 
    				joinColumns = {@JoinColumn(name = "ProjetID")},
    				inverseJoinColumns = {@JoinColumn(name = "LivrableID")})
    				private  List<Projet>  projet;
     
    	public  Livrable(){}
     
        public Livrable(int LivrableID, String LivrableName, String LivrableDescription, Date DateCRTLivrable, Date DateLivraison, String Nature, String type, String status, Version_Liv Version, Projet projets, List<Historique_Liv> LivHistory, List<Projet> projet) {
            this.LivrableID = LivrableID;
            this.LivrableName = LivrableName;
            this.LivrableDescription = LivrableDescription;
            this.DateCRTLivrable = DateCRTLivrable;
            this.DateLivraison = DateLivraison;
            this.Nature = Nature;
            this.type = type;
            this.status = status;
            this.Version = Version;
            this.projets = projets;
            this.LivHistory = LivHistory;
            this.projet = projet;
        }
     
     
     
     
    	public int getLivrableID() {
    		return LivrableID;
    	}
    	public void setLivrableID(int livrableID) {
    		LivrableID = livrableID;
    	}
    	public String getLivrableName() {
    		return LivrableName;
    	}
    	public void setLivrableName(String livrableName) {
    		LivrableName = livrableName;
    	}
    	public String getLivrableDescription() {
    		return LivrableDescription;
    	}
    	public void setLivrableDescription(String livrableDescription) {
    		LivrableDescription = livrableDescription;
    	}
     
        public Date getDateCRTLivrable() {
            return DateCRTLivrable;
        }
     
        public void setDateCRTLivrable(Date DateCRTLivrable) {
            this.DateCRTLivrable = DateCRTLivrable;
        }
     
        public Date getDateLivraison() {
            return DateLivraison;
        }
     
        public void setDateLivraison(Date DateLivraison) {
            this.DateLivraison = DateLivraison;
        }
     
        public Projet getProjets() {
            return projets;
        }
     
        public void setProjets(Projet projets) {
            this.projets = projets;
        }
     
     
     
     
        public List<Historique_Liv> getLivHistory() {
            return LivHistory;
        }
     
        public void setLivHistory(List<Historique_Liv> LivHistory) {
            this.LivHistory = LivHistory;
        }
     
     
        public Version_Liv getVersion() {
            return Version;
        }
     
        public void setVersion(Version_Liv Version) {
            this.Version = Version;
        }
     
        public List<Projet> getProjet() {
            return projet;
        }
     
        public void setProjet(List<Projet> projet) {
            this.projet = projet;
        }
     
        public String getNature() {
            return Nature;
        }
     
        public void setNature(String Nature) {
            this.Nature = Nature;
        }
     
        public String getStatus() {
            return status;
        }
     
        public void setStatus(String status) {
            this.status = status;
        }
     
        public String getType() {
            return type;
        }
     
        public void setType(String type) {
            this.type = type;
        }
     
        @Override
        public String toString() {
            return "Livrable{" + "LivrableID=" + LivrableID + "LivrableName=" + LivrableName + "LivrableDescription=" + LivrableDescription + "DateCRTLivrable=" + DateCRTLivrable + "DateLivraison=" + DateLivraison + "Nature=" + Nature + "type=" + type + "status=" + status + "Version=" + Version + "projets=" + projets + "LivHistory=" + LivHistory + "projet=" + projet + '}';
        }
     
     
     
     
     
        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Livrable other = (Livrable) obj;
            if (this.LivrableID != other.LivrableID) {
                return false;
            }
            if ((this.LivrableName == null) ? (other.LivrableName != null) : !this.LivrableName.equals(other.LivrableName)) {
                return false;
            }
            if ((this.LivrableDescription == null) ? (other.LivrableDescription != null) : !this.LivrableDescription.equals(other.LivrableDescription)) {
                return false;
            }
            if (this.DateCRTLivrable != other.DateCRTLivrable && (this.DateCRTLivrable == null || !this.DateCRTLivrable.equals(other.DateCRTLivrable))) {
                return false;
            }
            if (this.DateLivraison != other.DateLivraison && (this.DateLivraison == null || !this.DateLivraison.equals(other.DateLivraison))) {
                return false;
            }
            if ((this.Nature == null) ? (other.Nature != null) : !this.Nature.equals(other.Nature)) {
                return false;
            }
            if ((this.type == null) ? (other.type != null) : !this.type.equals(other.type)) {
                return false;
            }
            if ((this.status == null) ? (other.status != null) : !this.status.equals(other.status)) {
                return false;
            }
            if (this.Version != other.Version && (this.Version == null || !this.Version.equals(other.Version))) {
                return false;
            }
            if (this.projets != other.projets && (this.projets == null || !this.projets.equals(other.projets))) {
                return false;
            }
            if (this.LivHistory != other.LivHistory && (this.LivHistory == null || !this.LivHistory.equals(other.LivHistory))) {
                return false;
            }
            if (this.projet != other.projet && (this.projet == null || !this.projet.equals(other.projet))) {
                return false;
            }
            return true;
        }
     
        @Override
        public int hashCode() {
            int hash = 7;
            hash = 37 * hash + this.LivrableID;
            hash = 37 * hash + (this.LivrableName != null ? this.LivrableName.hashCode() : 0);
            hash = 37 * hash + (this.LivrableDescription != null ? this.LivrableDescription.hashCode() : 0);
            hash = 37 * hash + (this.DateCRTLivrable != null ? this.DateCRTLivrable.hashCode() : 0);
            hash = 37 * hash + (this.DateLivraison != null ? this.DateLivraison.hashCode() : 0);
            hash = 37 * hash + (this.Nature != null ? this.Nature.hashCode() : 0);
            hash = 37 * hash + (this.type != null ? this.type.hashCode() : 0);
            hash = 37 * hash + (this.status != null ? this.status.hashCode() : 0);
            hash = 37 * hash + (this.Version != null ? this.Version.hashCode() : 0);
            hash = 37 * hash + (this.projets != null ? this.projets.hashCode() : 0);
            hash = 37 * hash + (this.LivHistory != null ? this.LivHistory.hashCode() : 0);
            hash = 37 * hash + (this.projet != null ? this.projet.hashCode() : 0);
            return hash;
        }
     
     
     
    }
    l entité projet:
    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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
     
    package com.bean.ModuleProjet.User.entitites;
     
     
    import com.bean.ModuleExigence.Livrable.entities.*;
    import com.bean.ModuleRisque.entities.*;
    import java.io.Serializable;
     
     
    import java.util.Calendar;
    import java.util.Date;
     
    import java.util.List;
     
     
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.ManyToOne;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.OneToMany;
    import javax.persistence.Temporal;
     
    @Entity
    @NamedQueries( {
    @NamedQuery(name ="listeProjets",query = "SELECT ct FROM  Projet  ct"),
    @NamedQuery(name = "findAllProjetsID", query = "SELECT c FROM Projet c WHERE c.ProjetID=:ProjetID")
    })
    public class Projet implements  Serializable   {
     
     
      /**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	@Id
    	@GeneratedValue(strategy=GenerationType.IDENTITY)  
       private  int  ProjetID;
      private  String ProjetName;
      private  String Objectif ;
     
        @Temporal(javax.persistence.TemporalType.DATE)
      private  Date  DateCRT;
     
        @Temporal(javax.persistence.TemporalType.DATE)
      private   Date DateDebutPrevu;
     
        @Temporal(javax.persistence.TemporalType.DATE)
      private   Date   DateFinPrevu;
     
        @Temporal(javax.persistence.TemporalType.DATE)
      private   Date  DateDebutReel;
     
        @Temporal(javax.persistence.TemporalType.DATE)
      private   Date  DateFinReel;
       private  Float  Budget;
       private  int  Charge_projet ;
       private  String  Descritpion;
       @JoinColumn(name="UserID_fk", nullable=false)
       @ManyToOne(fetch=FetchType.LAZY)
       private  Users  user;
       private  String status_projet;
     
       private  String priorite_projet;
       @JoinColumn(name="CategorieProjet_fk", nullable=false)
       @ManyToOne(fetch=FetchType.LAZY)
       private Categorie_Projet  categorie_projet;
     
       private String  complexite;
       @OneToMany(mappedBy = "projet")
    	private List<Exigence> projet;
       @OneToMany(mappedBy = "projet")
    	private List<Risque> proj;
     
     
       @OneToMany(mappedBy ="projs")
      	private List<Projet_Ressource> projRessource;
     
       @OneToMany(mappedBy = "projets")
    	private List<Livrable> ProjetLiv;
     
     
       public  Projet(){}
     
        public Categorie_Projet getCategorie_projet() {
            return categorie_projet;
        }
     
        public void setCategorie_projet(Categorie_Projet categorie_projet) {
            this.categorie_projet = categorie_projet;
        }
     
     
        public List<Risque> getProj() {
            return proj;
        }
     
        public void setProj(List<Risque> proj) {
            this.proj = proj;
        }
     
        public List<Projet_Ressource> getProjRessource() {
            return projRessource;
        }
     
        public void setProjRessource(List<Projet_Ressource> projRessource) {
            this.projRessource = projRessource;
        }
     
        public List<Exigence> getProjet() {
            return projet;
        }
     
        public void setProjet(List<Exigence> projet) {
            this.projet = projet;
        }
     
     
        public Users getUser() {
            return user;
        }
     
        public void setUser(Users user) {
            this.user = user;
        }
     
        public String getComplexite() {
            return complexite;
        }
     
        public void setComplexite(String complexite) {
            this.complexite = complexite;
        }
     
        public String getPriorite_projet() {
            return priorite_projet;
        }
     
        public void setPriorite_projet(String priorite_projet) {
            this.priorite_projet = priorite_projet;
        }
     
        public String getStatus_projet() {
            return status_projet;
        }
     
        public void setStatus_projet(String status_projet) {
            this.status_projet = status_projet;
        }
     
        public List<Livrable> getProjetLiv() {
            return ProjetLiv;
        }
     
        public void setProjetLiv(List<Livrable> ProjetLiv) {
            this.ProjetLiv = ProjetLiv;
        }
     
        public Projet(String ProjetName, String Objectif, Date DateCRT, Date DateDebutPrevu, Date DateFinPrevu, Date DateDebutReel, Date DateFinReel, Float Budget, int Charge_projet, String Descritpion, Users user, String status_projet, String priorite_projet, Categorie_Projet categorie_projet, String complexite, List<Exigence> projet, List<Risque> proj, List<Projet_Ressource> projRessource, List<Livrable> ProjetLiv) {
            this.ProjetName = ProjetName;
            this.Objectif = Objectif;
            this.DateCRT = DateCRT;
            this.DateDebutPrevu = DateDebutPrevu;
            this.DateFinPrevu = DateFinPrevu;
            this.DateDebutReel = DateDebutReel;
            this.DateFinReel = DateFinReel;
            this.Budget = Budget;
            this.Charge_projet = Charge_projet;
            this.Descritpion = Descritpion;
            this.user = user;
            this.status_projet = status_projet;
            this.priorite_projet = priorite_projet;
            this.categorie_projet = categorie_projet;
            this.complexite = complexite;
            this.projet = projet;
            this.proj = proj;
            this.projRessource = projRessource;
            this.ProjetLiv = ProjetLiv;
        }
     
     
     
    public int getProjetID() {
    	return ProjetID;
    }
    public void setProjetID(int projetID) {
    	ProjetID = projetID;
    }
    public String getProjetName() {
    	return ProjetName;
    }
    public void setProjetName(String projetName) {
    	ProjetName = projetName;
    }
    public String getObjectif() {
    	return Objectif;
    }
    public void setObjectif(String objectif) {
    	Objectif = objectif;
    }
     
        public  Date getDateCRT() {
            return DateCRT;
        }
     
        public void setDateCRT( Date DateCRT) {
            this.DateCRT = DateCRT;
        }
     
        public  Date getDateDebutPrevu() {
            return DateDebutPrevu;
        }
     
        public void setDateDebutPrevu( Date DateDebutPrevu) {
            this.DateDebutPrevu = DateDebutPrevu;
        }
     
        public  Date getDateDebutReel() {
            return DateDebutReel;
        }
     
        public void setDateDebutReel( Date DateDebutReel) {
            this.DateDebutReel = DateDebutReel;
        }
     
        public Date getDateFinPrevu() {
            return DateFinPrevu;
        }
     
        public void setDateFinPrevu( Date DateFinPrevu) {
            this.DateFinPrevu = DateFinPrevu;
        }
     
        public Date getDateFinReel() {
            return DateFinReel;
        }
     
        public void setDateFinReel( Date DateFinReel) {
            this.DateFinReel = DateFinReel;
        }
     
     
     
     
    public Float getBudget() {
    	return Budget;
    }
    public void setBudget(Float budget) {
    	Budget = budget;
    }
    public int getCharge_projet() {
    	return Charge_projet;
    }
    public void setCharge_projet(int charge_projet) {
    	Charge_projet = charge_projet;
    }
    public String getDescritpion() {
    	return Descritpion;
    }
    public void setDescritpion(String descritpion) {
    	Descritpion = descritpion;
    }
    public static long getSerialversionuid() {
    	return serialVersionUID;
    }
     
        @Override
        public String toString() {
            return "Projet{" + "ProjetID=" + ProjetID + "ProjetName=" + ProjetName + "Objectif=" + Objectif + "DateCRT=" + DateCRT + "DateDebutPrevu=" + DateDebutPrevu + "DateFinPrevu=" + DateFinPrevu + "DateDebutReel=" + DateDebutReel + "DateFinReel=" + DateFinReel + "Budget=" + Budget + "Charge_projet=" + Charge_projet + "Descritpion=" + Descritpion + "user=" + user + "status_projet=" + status_projet + "priorite_projet=" + priorite_projet + "categorie_projet=" + categorie_projet + "complexite=" + complexite + "projet=" + projet + "proj=" + proj + "projRessource=" + projRessource + '}';
        }
     
        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Projet other = (Projet) obj;
            if (this.ProjetID != other.ProjetID) {
                return false;
            }
            if ((this.ProjetName == null) ? (other.ProjetName != null) : !this.ProjetName.equals(other.ProjetName)) {
                return false;
            }
            if ((this.Objectif == null) ? (other.Objectif != null) : !this.Objectif.equals(other.Objectif)) {
                return false;
            }
            if (this.DateCRT != other.DateCRT && (this.DateCRT == null || !this.DateCRT.equals(other.DateCRT))) {
                return false;
            }
            if (this.DateDebutPrevu != other.DateDebutPrevu && (this.DateDebutPrevu == null || !this.DateDebutPrevu.equals(other.DateDebutPrevu))) {
                return false;
            }
            if (this.DateFinPrevu != other.DateFinPrevu && (this.DateFinPrevu == null || !this.DateFinPrevu.equals(other.DateFinPrevu))) {
                return false;
            }
            if (this.DateDebutReel != other.DateDebutReel && (this.DateDebutReel == null || !this.DateDebutReel.equals(other.DateDebutReel))) {
                return false;
            }
            if (this.DateFinReel != other.DateFinReel && (this.DateFinReel == null || !this.DateFinReel.equals(other.DateFinReel))) {
                return false;
            }
            if (this.Budget != other.Budget && (this.Budget == null || !this.Budget.equals(other.Budget))) {
                return false;
            }
            if (this.Charge_projet != other.Charge_projet) {
                return false;
            }
            if ((this.Descritpion == null) ? (other.Descritpion != null) : !this.Descritpion.equals(other.Descritpion)) {
                return false;
            }
            if (this.user != other.user && (this.user == null || !this.user.equals(other.user))) {
                return false;
            }
            if ((this.status_projet == null) ? (other.status_projet != null) : !this.status_projet.equals(other.status_projet)) {
                return false;
            }
            if ((this.priorite_projet == null) ? (other.priorite_projet != null) : !this.priorite_projet.equals(other.priorite_projet)) {
                return false;
            }
            if (this.categorie_projet != other.categorie_projet && (this.categorie_projet == null || !this.categorie_projet.equals(other.categorie_projet))) {
                return false;
            }
            if ((this.complexite == null) ? (other.complexite != null) : !this.complexite.equals(other.complexite)) {
                return false;
            }
            if (this.projet != other.projet && (this.projet == null || !this.projet.equals(other.projet))) {
                return false;
            }
            if (this.proj != other.proj && (this.proj == null || !this.proj.equals(other.proj))) {
                return false;
            }
            if (this.projRessource != other.projRessource && (this.projRessource == null || !this.projRessource.equals(other.projRessource))) {
                return false;
            }
            if (this.ProjetLiv != other.ProjetLiv && (this.ProjetLiv == null || !this.ProjetLiv.equals(other.ProjetLiv))) {
                return false;
            }
            return true;
        }
     
        @Override
        public int hashCode() {
            int hash = 3;
            hash = 37 * hash + this.ProjetID;
            hash = 37 * hash + (this.ProjetName != null ? this.ProjetName.hashCode() : 0);
            hash = 37 * hash + (this.Objectif != null ? this.Objectif.hashCode() : 0);
            hash = 37 * hash + (this.DateCRT != null ? this.DateCRT.hashCode() : 0);
            hash = 37 * hash + (this.DateDebutPrevu != null ? this.DateDebutPrevu.hashCode() : 0);
            hash = 37 * hash + (this.DateFinPrevu != null ? this.DateFinPrevu.hashCode() : 0);
            hash = 37 * hash + (this.DateDebutReel != null ? this.DateDebutReel.hashCode() : 0);
            hash = 37 * hash + (this.DateFinReel != null ? this.DateFinReel.hashCode() : 0);
            hash = 37 * hash + (this.Budget != null ? this.Budget.hashCode() : 0);
            hash = 37 * hash + this.Charge_projet;
            hash = 37 * hash + (this.Descritpion != null ? this.Descritpion.hashCode() : 0);
            hash = 37 * hash + (this.user != null ? this.user.hashCode() : 0);
            hash = 37 * hash + (this.status_projet != null ? this.status_projet.hashCode() : 0);
            hash = 37 * hash + (this.priorite_projet != null ? this.priorite_projet.hashCode() : 0);
            hash = 37 * hash + (this.categorie_projet != null ? this.categorie_projet.hashCode() : 0);
            hash = 37 * hash + (this.complexite != null ? this.complexite.hashCode() : 0);
            hash = 37 * hash + (this.projet != null ? this.projet.hashCode() : 0);
            hash = 37 * hash + (this.proj != null ? this.proj.hashCode() : 0);
            hash = 37 * hash + (this.projRessource != null ? this.projRessource.hashCode() : 0);
            hash = 37 * hash + (this.ProjetLiv != null ? this.ProjetLiv.hashCode() : 0);
            return hash;
        }
     
     
     
     
     
     
     
    }
    et voici l entité version

    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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
     
    package com.bean.ModuleExigence.Livrable.entities;
     
    import java.io.Serializable;
     
     
    import java.util.List;
     
     
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.OneToMany;
     
    @Entity
    @NamedQueries( {
    @NamedQuery(name = "findAllVersionLiv", query = "SELECT ct FROM Version_Liv  ct")
    ,
    @NamedQuery(name = "findAllVersionID", query = "SELECT c FROM Version_Liv c WHERE c.VersionLivID=:VersionLivID")
    } )
    public class Version_Liv implements  Serializable {
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	@Id
    	@GeneratedValue(strategy=GenerationType.IDENTITY)  
    	private int  VersionLivID;
    	private  String VersionName;
    	private  String  VersionDescription;
    	@OneToMany(mappedBy = "Version")
    	private List<Livrable> version;
            @OneToMany(mappedBy ="versionLiv")
      	private List<Historique_Liv> historyLiv;
     
    	public Version_Liv() {
     
    	}
    	public Version_Liv(int versionLivID, String versionName,
    			String versionDescription) {
    		super();
    		VersionLivID = versionLivID;
    		VersionName = versionName;
    		VersionDescription = versionDescription;
    	}
    	public long getVersionLivID() {
    		return VersionLivID;
    	}
    	public void setVersionLivID(int versionLivID) {
    		VersionLivID = versionLivID;
    	}
    	public String getVersionName() {
    		return VersionName;
    	}
    	public void setVersionName(String versionName) {
    		VersionName = versionName;
    	}
    	public String getVersionDescription() {
    		return VersionDescription;
    	}
    	public void setVersionDescription(String versionDescription) {
    		VersionDescription = versionDescription;
    	}
    	@Override
    	public String toString() {
    		return "Version_Liv [VersionLivID=" + VersionLivID + ", VersionName="
    				+ VersionName + ", VersionDescription=" + VersionDescription
    				+ "]";
    	}
     
     
     
    }

    merci d avance

  4. #4
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 70
    Points : 83
    Points
    83
    Par défaut
    Essaye ca voir.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
     public List<Livrable> RechercheLivrableParProjet(int idprojet) {
            String  requete ="SELECT l.LivrableName, p.ProjetName, l.DateCRTLivrable, l.DateLivraison, l.Nature, l.type, l.status, v.VersionName"
                    + " FROM  Livrable l ,Projet p, Version_Liv v"
                    + " WHERE  p =l.projets "
                    + "AND  v=l.Version"
                    + " AND  p.ProjetID= :ProjetID";
            Query  req=em.createQuery(requete);
            req.setParameter("ProjetID",idprojet);
            return req.getResultList();
        }

  5. #5
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    merci bcp de ta reponse maintenant ça ne gere pas d erreur mais seulement ça n affiche rien dans mon tableau voici comment j ai defini dans le bean et dans le .jsf

    la fonction recherche: dan le bean
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    @EJB
    private  LivrableSessionBeanLocal  livrableBean;
     private  List<Livrable>  listeResultatsLivrable;
    //les  getters et setters
     
        public String  RechercheLivrableParProjet()
        {
               List<Livrable> listeLivrables;
               listeLivrables =livrableBean.RechercheLivrableParProjet(ProjetID);
               listeResultatsLivrable= listeLivrables;
               return  "listResultatRecherche";
        }
    voici le fichier RechercheLivrale.xhtml
    qui affiche une liste deroulente qui contient les projets du livrable et un bouton de recherche
    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
    16
    17
    18
    19
    20
    21
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            <h:form>
                <h2> Recherche  Livrable</h2>
                <h3> Selectionner  votre  Critere</h3>
                <h:panelGrid>
                    <h:outputLabel  value="Projet"></h:outputLabel>
                    <h:selectOneMenu   value="#{livrableManager.projetID}">
                    <f:selectItems  value="#{livrableManager.projetLivItems}"> </f:selectItems>
                    </h:selectOneMenu>
                    <h:commandButton  value="Recherche  par Projet"  action="#{livrableManager.RechercheLivrableParProjet}">
                    </h:commandButton>
                </h:panelGrid>
            </h:form>
        </h:body>
    </html>
    le fichier listResultatRecherche.xhtml qui recuperer les données du livrable de chaque projet
    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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            <h:form>
                <h2><h:outputLabel  value=" voici les  resultats  de  la  Recherche"/> </h2>
     
                <h:dataTable value="#{livrableManager.listeResultatsLivrable}" var="res"   border="2"
                      cellspacing="2" width="80%" >
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Nom Livrable"/>
                        </f:facet>
                        <h:outputText value="#{res.livrableName}">
                            </h:outputText>
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="Date Creation"/>
                        </f:facet>
                         <h:outputText value="#{res.dateCRTLivrable}">
                          <f:convertDateTime pattern="dd/MM/yyyy"/>
                          </h:outputText>
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="Date Livraison"/>
                        </f:facet>
                         <h:outputText value="#{res.dateLivraison}">
                          <f:convertDateTime pattern="dd/MM/yyyy"/>
                          </h:outputText>  
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="statut"/>
                        </f:facet>
                         <h:outputText value="#{res.status}"/>
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="nature"/>
                        </f:facet>
                         <h:outputText value="#{res.nature}"/>
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="type"/>
                        </f:facet>
                         <h:outputText value="#{res.type}"/>
                    </h:column>
                     <h:column>
                        <f:facet name="header">
                            <h:outputText value="Version"/>
                        </f:facet>
                         <h:outputText value="#{res.version.versionName}"/>
                    </h:column>
                     <h:column>
                         <f:facet name="header">
                             <h:outputText value="Modifier"/>
                         </f:facet>
                         <h:commandLink  value="Modifier" action="#{livrableManager.modifierLivrable}"/>
     
                     </h:column>
                    <h:column>
                         <f:facet name="header">
                             <h:outputText value="Modifier"/>
                         </f:facet>
                           <h:commandLink    value="Supprimer" action="#{livrableManager.supprimerLivrable}"
                              onclick="return confirm('Voulez-vous supprimer ce projet #{projet.projetName}  ?');" >
               		<f:ajax execute="@this" render="@form"  />
                             </h:commandLink>
                   </h:column>
                </h:dataTable>
     
            </h:form>
     
        </h:body>
    </html>
    merci d avance

  6. #6
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 70
    Points : 83
    Points
    83
    Par défaut
    Essaye d'exécuter la requête native SQL généré par Hibernate. Et dis moi si tu vois tes enregistrement.

  7. #7
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    merci encore , j ai exécuté la requête sql et je voix tres bien mes resultats j aimerai savoir ou on peut tester les requetes jpql et merci d avance .

  8. #8
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    j ai essai de revoir mes listes et mes fonctions j ai mm teste la requete sql tous marche bien , je pense le probleme n est plus au niveau de la requete mais plus tot au niveau de l 'affichage voici l erreur qu il me genere :
    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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
     
    GRAVE: Error Rendering View[/listResultatRecherche.xhtml]
    java.lang.NumberFormatException: For input string: "livrableName"
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
            at java.lang.Integer.parseInt(Integer.java:449)
            at java.lang.Integer.parseInt(Integer.java:499)
            at javax.el.ArrayELResolver.toInteger(ArrayELResolver.java:375)
            at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:195)
            at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
            at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
            at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
            at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
            at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
            at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102)
            at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
            at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
            at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
            at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
            at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)
            at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
            at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
            at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:295)
            at com.sun.faces.renderkit.html_basic.TableRenderer.renderRow(TableRenderer.java:380)
            at com.sun.faces.renderkit.html_basic.TableRenderer.encodeChildren(TableRenderer.java:161)
            at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
            at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
            at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
            at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
            at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
            at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
            at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
            at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
            at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
            at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
            at java.lang.Thread.run(Thread.java:662)

  9. #9
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 70
    Points : 83
    Points
    83
    Par défaut
    Citation Envoyé par diengkals Voir le message
    merci encore , j ai exécuté la requête sql et je voix tres bien mes resultats j aimerai savoir ou on peut tester les requetes jpql et merci d avance .
    Tester les requêtes JPQL !!!! ca va pas être simple.
    Ce que je te propose c'est me mettre u print dans ta méthode RechercheLivrableParProjet.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    @EJB
    private  LivrableSessionBeanLocal  livrableBean;
     private  List<Livrable>  listeResultatsLivrable;
    //les  getters et setters
     
        public String  RechercheLivrableParProjet()
        {
               List<Livrable> listeLivrables;
               listeLivrables =livrableBean.RechercheLivrableParProjet(ProjetID);
               listeResultatsLivrable= listeLivrables;
     
               return  "listResultatRecherche";
        }

  10. #10
    Membre actif Avatar de MaitreKaio
    Profil pro
    Freelance Java / Web / Mobile
    Inscrit en
    Juin 2007
    Messages
    140
    Détails du profil
    Informations personnelles :
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Freelance Java / Web / Mobile
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juin 2007
    Messages : 140
    Points : 240
    Points
    240
    Par défaut
    GRAVE: Error Rendering View[/listResultatRecherche.xhtml]
    java.lang.NumberFormatException: For input string: "livrableName"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:449)

    J'ai fortement l'impression que tu essaies dans ta page d'afficher ce que tu appelles livrableName (certainement une chaine de caractères donc) comme si c'était un nombre. D'où l'exception...

  11. #11
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    70
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 70
    Points : 83
    Points
    83
    Par défaut
    Je crois comprendre ce que tu veux faire. remplace ta requête par ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    public List<Livrable> RechercheLivrableParProjet(int idprojet) {
            String  requete ="SELECT l"
                    + " FROM  Livrable l ,Projet p, Version_Liv v"
                    + " WHERE  p =l.projets "
                    + "AND  v=l.Version"
                    + " AND  p.ProjetID= :ProjetID";
            Query  req=em.createQuery(requete);
            req.setParameter("ProjetID",idprojet);
            return req.getResultList();
        }
    Comme ca tu auras une liste de Livrable s au lieu d'une liste de tableaux.

  12. #12
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    merci bcp de vos réponses maintenant le problème n'est pas au niveau de la requête mais plutôt au niveau de l'affiche car si je doit lister deux lignes ça m'affiche un tableau de deux lignes vides si c trois 3 ligne ça m affiche un tableau de 3 lignes vide . Donc je vais revoir comment je vais régler le problème de l'affichage si tu tout va bien je vous faire signe et merci infiniment.

  13. #13
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2010
    Messages
    391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Mauritanie

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2010
    Messages : 391
    Points : 113
    Points
    113
    Par défaut
    merci à tous j ai resolu mon probleme j avias oublier var dans dans mon dataTable et merci bcp

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Erreur d'exécution avec les Runtime
    Par denils dans le forum Runtime
    Réponses: 30
    Dernier message: 22/01/2015, 15h21
  2. Erreur avec les requêtes préparées
    Par hannibal.76 dans le forum Bases de données
    Réponses: 2
    Dernier message: 15/04/2012, 10h09
  3. [heritage] quelle syntaxe pour les requêtes avec Mysql
    Par tavarlindar dans le forum Requêtes
    Réponses: 7
    Dernier message: 07/05/2008, 23h47
  4. [MySQL] Erreur de syntaxe sur ma requête SELECT
    Par vincedjs dans le forum PHP & Base de données
    Réponses: 14
    Dernier message: 08/03/2006, 11h50
  5. Erreur de syntaxe avec UPDATE
    Par tyarak dans le forum Requêtes
    Réponses: 3
    Dernier message: 01/02/2006, 01h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo