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 8115765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:34:25+00:00 2026-06-06T03:34:25+00:00

In my GAE project I started with JPA 1.0 and this code worked great:

  • 0

In my GAE project I started with JPA 1.0 and this code worked great:

    Query query = em.createQuery("SELECT FROM MyImage " +
                                 "WHERE m_Email = :email " +
                                 "And m_Password = :password ", MyImage.class);
    query.setParameter("email", email);
    query.setParameter("password", password);

But now that I working with JPA 2.0 I get:

FROM clause of query has class util.MyImage but no alias
org.datanucleus.store.query.QueryCompilerSyntaxException: FROM clause of query has class util.MyImage but no alias
at org.datanucleus.query.compiler.JavaQueryCompiler.compileFrom(JavaQueryCompiler.java:233)
at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:79)
at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:269)
at org.datanucleus.store.query.Query.setImplicitParameter(Query.java:825)
at org.datanucleus.api.jpa.JPAQuery.setParameter(JPAQuery.java:458)
at org.datanucleus.api.jpa.JPAQuery.setParameter(JPAQuery.java:57)
at dataBase.DataBase.getMyImageFromDB(DataBase.java:173)

I manged to get it work with CriteriaQuery but the code is not readable and a little bit messy.

Any idea how to fix this exception?

  • 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-06-06T03:34:27+00:00Added an answer on June 6, 2026 at 3:34 am

    I think you need to define an alias for your class like this:

    Query query = em.createQuery("SELECT i FROM MyImage i " + 
                                 "WHERE i.m_Email = :email " + 
                                 "And i.m_Password = :password ", MyImage.class);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have produced a new Maven Project from gae-archetype-gwt from within IntelliJ, and everything
I am just starting out learning Java, GAE etc. I have started a project
I have a Java + GAE + JPA project and I want introduce Objectify
When I first started developing this project, there was no requirement for generating large
I just started making a a new web project using GAE SDK without GWT
I'm playing with a GWT/GAE project which will have three different pages, although it
I want to share some modules between a python GAE project, and another python
I am working on a project that uses GAE as the backend for a
I am doing my course project, and I am the only one choose GAE.
My GAE app runs fine from my computer, but when I upload it, I

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.