Bonjour,

already exist ... Cette donnée est déjà effectivement utilisée mais dans un autre package.java,

OU est mon erreur , j'ai 2 tables postgresql ( article & bilan) et je dois afficher une donnée de chacune dans le popup de mon IHM.
Les données des la tables sont ensuite utilisées dans des tags pour calculs qui sont enregistrés dans la table article.

GLASSFISH ME DIT CECI : Ignoring the @NamedQuery [Bilanprevisionnel.findByBipDecTauxmargeSurheure] specified on class [jpa.Article] since a query with that name already exists.

Pourtant j'ai bien mes tables (article & bilan) dans le JPA, je voulais savoir si mon erreur se situe ici ?

article.java
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
package jpa;
 
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
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.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
 
/**
 * @author XXXXX
 */
@Entity
@Table(name = "article", catalog = "xxx", schema = "public")
@NamedQueries({@NamedQuery(name = "Article.findAll", query = "SELECT a FROM Article a"),
@NamedQuery(name = "Article.findByArtIntId", query = "SELECT a FROM Article a WHERE a.artIntId = :artIntId"),
....
@NamedQuery(name = "Article.findByArtDecPrix", query = "SELECT a FROM Article a WHERE a.artDecPrix = :artDecPrix"),
@NamedQuery(name = "Article.findByArtDecCoefnum", query = "SELECT a FROM Article a WHERE a.artDecCoefnum = :artDecCoefnum"),
@NamedQuery(name = "Article.findByArtDecResultprixventeanalytique", query = "SELECT a FROM Article a WHERE a.artDecResultprixventeanalytique = :artDecResultprixventeanalytique"),
..
// ma table Bilan "ignorée"
@NamedQuery(name = "Bilan.findByBipDecTauxmarge", query = "SELECT b FROM Bilan b WHERE b.bipDecTauxmarge = :bipDecTauxmarge"),
..
 
public class Article implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "article_seq")
    @SequenceGenerator(name = "article_seq", sequenceName = "article_art_int_id_seq", allocationSize = 1)
..
    @Basic(optional = false)
    @Column(name = "art_int_id")
    private Integer artIntId;
..
// ici pas de probleme, ça marche avec la donnée de la table article
@Basic(optional = false)
    @Column(name = "art_dec_coefnum")
    private BigDecimal artDecCoefnum;
// concerne la donnée de la table bilan qui est ignorée
@Column(name = "bip_dec_tauxmarge")
   private BigDecimal bipDecTauxmarge;
..
  public Article() {
    }
    public Article(Integer artIntId) {
        this.artIntId = artIntId;
    }
..
 public Article(Integer artIntId,
            String artVchNom,
..
            BigDecimal artDecCoefnum,
             BigDecimal bipDecTauxmarge,
..
    public Article(Integer artIntId,
..
            BigDecimal artDecCoefnum,
             BigDecimal bipDecTauxmarge,
..
            Date artDateCreation) {
        this.artIntId = artIntId;
        this......
// donnée table article
        this.artDecCoefnum = artDecCoefnum;
// donnée table bilan
        this.bipDecTauxmarge = bipDecTauxmarge ;
    }
 // donnée table article 
  public Integer getArtIntId() {
        return artIntId;
    }
    public void setArtIntId(Integer artIntId) {
        this.artIntId = artIntId;
    }
//donnée table bilan
    public Integer getBipIntId() {
        return bipIntId;
    }
    public void setBipIntId(Integer bipIntId) {
        this.bipIntId = bipIntId;
    }
..
//donnée table article
    public BigDecimal getArtDecCoefnum() {
        return artDecCoefnumpopup;
    }
    public void setArtDecCoefnum(BigDecimal artDecCoefnum) {
        this.artDecCoefnum = artDecCoefnum;
    }
//donnée table bilan
    public BigDecimal getBiptDecTauxmarge() {
        return bipDecTauxmarge;
   }
    public void setBipDecTauxmarge(BigDecimal bipDecTauxmarge) {
       this.bipDecTauxmarge = bipDecTauxmarge;
    }
..
pouvez m'aider à comprendre, j'ai déjà fait mes autres codes (tag, action, form, xml,..) et je vais essayer de "re"visiter tout ça ensuite si mon erreur ne se situe pas là.

Merci par avance. je débute
dan