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

  • Home
  • SEARCH
  • 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 968149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:25:57+00:00 2026-05-16T02:25:57+00:00

Hello i have this HQL request and i have an error when I run

  • 0

Hello i have this HQL request and i have an error when I run it

My function:

public ProprietaireInt getProprietaireInt(String codeImmeuble, String annee) {
   //Create connexion
   Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
   ProprietaireInt proprietaireInt = new ProprietaireInt();
   try{
         String query = "SELECT pi.siren,pi.codeSCI,pi.libSocieteInterne,pi.libSocieteNormalise,pi.codeDomainePilotage " +
                        "FROM ImmeubleFisc if" +
                        "JOIN proprietaireInt pi ON if.sirenProprietaire = pi.siren " +
                        "WHERE if.idImmeubleFisc.codeImmeuble = :codeImmeuble " +
                        "AND if.idImmeubleFisc.exerciceFiscal = :annee";
        Query q = null;
        q = session.createQuery(query);
        q.setString("codeImmeuble", codeImmeuble);
        q.setString("annee", annee);

        proprietaireInt = (ProprietaireInt) q.uniqueResult();
        session.flush();
    }
    catch (Exception e)
    {
       System.out.println(e.getMessage()+" "+e.getStackTrace());
    }
    return  proprietaireInt;
}

My errror :

2010-08-02 12:12:22,081 ERROR
ast.ErrorCounter
(ErrorCounter.java:33) – line 1:156:
unexpected token: proprietaireInt

  • 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-16T02:25:58+00:00Added an answer on May 16, 2026 at 2:25 am

    I am not sure if JOIN ON is supported (see HHH-16 and HHH-620) but, assuming ProprietaireInt is an entity, I guess the JOIN clause should be (note the uppercase first letter):

    JOIN ProprietaireInt pi ...
    

    Also since you’re using projections (without a constructor expression), you’ll get a Object[] as result and I don’t think the following will work:

    proprietaireInt = (ProprietaireInt) q.uniqueResult();
    

    From the reference documentation:

    14.6. The select clause

    …

    Queries can return multiple objects
    and/or properties as an array of type
    Object[]:

    select mother, offspr, mate.name
    from DomesticCat as mother
        inner join mother.mate as mate
        left outer join mother.kittens as offspr
    

    Or as a List:

    select new list(mother, offspr, mate.name)
    from DomesticCat as mother
        inner join mother.mate as mate
        left outer join mother.kittens as offspr
    

    Or – assuming that the class Family
    has an appropriate constructor – as an
    actual typesafe Java object:

    select new Family(mother, mate, offspr)
    from DomesticCat as mother
        join mother.mate as mate
        left join mother.kittens as offspr
    

    See also

    • 14.3. Associations and joins
    • 14.4. Forms of join syntax
    • 14.6. The select clause
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
Hello i have this following function: ... var model = $(#carModel); .... model.change(validModel); function
I have done this: $ z() { echo 'hello world'; } How do I
I have the following line: 14:48 say;0ed673079715c343281355c2a1fde843;2;laka;hello ;) I parse this by using a
This is the HTML: <div id=testBlue> <span>hello</span> <span id=testGreen class=testGreen>hello2</span> </div> If I have
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Say for example I have the following string: var testString = Hello, world; And
Hello i have this in a batch: :passw022 title batch :: Password if exist
Hello i have this foreach loop that gives weird result , it displays only
Hello I have this program which reverses letters I enter. I'm using iostream .

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.