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

JPA Java Discussion :

Erreur de syntaxe ")" avec EclipseLink-4002


Sujet :

JPA Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    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
    Par défaut Erreur de syntaxe ")" avec EclipseLink-4002
    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= rojetID";
    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
    aused 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)))")
    franchement je ne voix pas l erreur de syntaxe a ce que je sache
    aidez moi svp
    merci d avance

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Décembre 2008
    Messages
    20
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2008
    Messages : 20
    Par défaut
    Bonjour,
    Peut-on avoir le mapping des entities Projet, Livrable et Version_Liv, vu que les requêtes SQL sont générées à partir du mapping, ça pourra aider à l'investigation.

    Merci

  3. #3
    Membre éclairé
    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
    Par défaut
    merci pour votre reponse et je l'avais deja poster au Forum des professionnels en informatique > Java > Serveurs, conteneurs, et Java EE > Java EE .Maintentant ça n affiche pas d erreur mais j ai un problème d affiche . ça affiche un tableau vide a chaque fois et pourtant j ai tester la requete et ça me donne le résultat . ce qui un peu bizarre c est ça me donne un tableau du nombre ligne qu il doit retouner

    bon voici mes classe et mes fichier.xhrml et merci d avance




    entity 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
     
    @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;
            }
    entity 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
     
    @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;
        }
     
     
     
    }
    et voici l entité Version_Liv

    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
     
      @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
    				+ "]";
    	}
     
     
     
    }
    et voici ma methode RechercheLivrableParProjet dans Session Bean
    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();
        }
    et ma methode RecherhceLivrable dans Managerbean
    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
     
     
    @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
    22
     
    <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
          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>

  4. #4
    Membre éclairé
    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
    Par défaut
    merci j ai un probleme j avais ou oublier var dans dataTable

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

Discussions similaires

  1. Erreur de syntaxe sur trigger avec mysql 5.1
    Par WhoIsTiti dans le forum SQL Procédural
    Réponses: 4
    Dernier message: 29/03/2012, 07h18
  2. [POO] Erreur de syntaxe avec une classe
    Par sirbaldur dans le forum Langage
    Réponses: 5
    Dernier message: 10/01/2007, 13h30
  3. [Conception] Erreur de syntaxe avec un champ de tableau
    Par lodan dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 21/09/2006, 11h45
  4. Erreur de syntaxe avec UPDATE
    Par tyarak dans le forum Requêtes
    Réponses: 3
    Dernier message: 01/02/2006, 01h18
  5. [MySQL] Supprimer les erreurs de syntaxe dues aux quotes
    Par gotenks dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 25/01/2006, 16h10

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