Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7521157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:11:19+00:00 2026-05-30T02:11:19+00:00

I have encountered a problem since one hour..take me as a beginner please.. The

  • 0

I have encountered a problem since one hour..take me as a beginner please..

The query is very simple :

public List<String> finArticleByfamille(String famille){
EntityManager em = getEntityManager();
Query qr= em.createQuery("SELECT a.libel FROM Article a WHERE a.famille_idfamille =   '"+famille+"'");

return qr.getResultList();
}

also I have tried this :

public List<String> finArticleByfamille(String famille){
EntityManager em = getEntityManager();
Query qr= em.createQuery("SELECT a.libel FROM Article a WHERE a.familleIdfamille =    '"+famille+"'");

return qr.getResultList();
}

“famille_idfamille” is a foreign key from the table “Famille”, see the screenshot:

enter image description here

the error comes from this call:

String famille=famille_produit_fact_direct.getSelectedItem().toString();
l_article=(Vector) ajc.finArticleByfamille(famille);

I get this Error :

Grave: null
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: An     exception occurred while creating a query in EntityManager: 
Exception Description: Error compiling the query [SELECT a.libel FROM Article a WHERE    a.famille_idfamille = 'famille2'], line 1, column 38: unknown state or association field   [famille_idfamille] of class [glob.entitys.Article].
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at javax.swing.SwingWorker.get(SwingWorker.java:602)
at glob.main$32.done(main.java:2068)
at javax.swing.SwingWorker$5.run(SwingWorker.java:737)

I respected the same name as the database, so why it does not work ?
(sorry for the french language)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:11:19+00:00Added an answer on May 30, 2026 at 2:11 am

    @Tim Gage thank you, I just noticed something..
    in my entity glob.entitys.Article I have familleIdfamille as field :

     @JoinColumn(name = "FAMILLE_IDFAMILLE", referencedColumnName = "IDFAMILLE", nullable = false)
     @ManyToOne(optional = false)
     private Famille familleIdfamille;
    

    Famille it is another entity..
    then it is normal that he does not know famille_idfamille ?

    EDIT:

    this comment its from the documentation :

    • The query string refers to the Employee entity and not to the table
      Employee of the Database…

    Then I put this:

    Query qr= em.createQuery("SELECT a.libel FROM Article a WHERE  a.familleIdfamille.idfamille = '"+famille+"'");
    

    and its worked;
    it is logical that it does not work, because the familleIdfamille is an instance of Famille entity…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered a problem in my application. I have two forms, one that
I am working with smartgwt since three months. I have encountered a problem with
I have encountered a problem that I have not come accross yet when setting
I have encountered a problem twice now whereby a producer thread produces N work
I have encountered a problem of placing data into the Table View. Here is
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -
I am using ajaxForm. Now I have encountered a problem. My idea is when
I am writing a class. I have encountered the problem in the title. Here
I've recently begun learning C# but have encountered an annoying problem. Every variable I
I have encountered a most annoying problem that occurs on the PWD variable when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.