j'ai fais ce que vous m'avez dis mais il me donne le meme erreur de requete
Exception Description: Error compiling the query [select c from Societe c where c.SPECIALITE_ID=:id], line 1, column 32: unknown state or association field [SPECIALITE_ID] of class [net.sispay.model.Societe].
XHTML:
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
|
<h:form id="formulairecontact" method="post" action="Demande.xhtml" >
<legend style="border-color: black; text-decoration: inherit;"></legend>
<div style="margin-top: 15px">
<h:outputText value="Selectionner Votre Choix: " />
<h:selectOneMenu value="#{societeBean.idSpec}">
<f:selectItems value="#{specialiteBean.specMap}"
/>
<f:ajax event="change" render=":formulairecontact:id1" listener="#{societeBean.changer}"/>
</h:selectOneMenu>
</div>
<br /><br />
<p:dataTable style="width: 500px" paginator="true" id="id1"
headerClass="header" var="societe" value="#{societeBean.toutes_les_sos}"
styleClass="table">
<p:column>
<h:selectBooleanCheckbox value="true" />
</p:column>
<p:column>
<f:facet name="header">
Societe
</f:facet>
<h:outputText value="#{societe.raisonSociale}" />
</p:column>
</p:dataTable><br/>
<p:commandButton value="Envoyer la Demande"
action="/Template/index.xhtml?faces-redirect=true" >
</p:commandButton>
</h:form> |
DAO:
1 2 3 4 5 6 7 8 9 10 11 12
|
public List<Societe> findByIdSpecialite(int IdSpecialite){
try {
Query query = em.createQuery("select c from Societe c where c.SPECIALITE_ID=:id");
query.setParameter("id", IdSpecialite);
return (List<Societe>) query.getResultList();
}catch(Exception e){
e.printStackTrace();
return null;
}
} |
Partager