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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:01:18+00:00 2026-06-16T20:01:18+00:00

I have a JAR which contains only my model which are annotated classes. Then

  • 0

I have a JAR which contains only my model which are annotated classes. Then the application which loads the JAR.

In the persistence.xml of the app I have:

<jar-file> my jar </jar-file>

and in the properties:

<property name="hibernate.archive.autodetection" value="class" />

That works. The entities are detected and this query works fine:

List<Event> events = em.createQuery(
"from com.my.namespace.model.Event", Event.class).getResultList();

However I absolutely need to have the namespace in the query… If I do:

List<Event> events = em.createQuery("from Event", Event.class).getResultList();

Then I get this exception:

Event is not mapped [from Event]

What is even more frustrating is that I give to JPA the class, Event.class as the second argument of my call. The Java codes imports the right package.

How do I get the JPAQL/HQL to “import” the right package to see that entity without needing to explicitely type the namespace?

Update: here is Event.java if it helps.. it is as trivial as it gets:

package com.my.namespace.model;

import javax.persistence.*;

@Entity(name="events")
@SequenceGenerator(name="events_id_seq", sequenceName="events_id_seq")
public class Event {

    @Id @Column(name="id") @GeneratedValue(generator="events_id_seq")
    private Long mId;

    @Column(name="title")
    private String mTitle;

    public Long getId() {
        return mId;
    }

    public String getTitle() {
        return mTitle;
    }

    public void setTitle(String title) {
        mTitle = title;
    }
}
  • 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-16T20:01:19+00:00Added an answer on June 16, 2026 at 8:01 pm

    @Entity(name="events") is the culprit

    it has to be

              @Entity
              @Table(name="events")
    

    If you intenteded events as db table name. Otherwise use events in your query instead of Event

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

Sidebar

Related Questions

For our Kunagi Java web application we have a signed kunagi.jar file which contains
I have got a JAR file which contains Utility classes, that are used in
I have the problem running executable .jar file. I've created a project which contains
I have a project that only needs to take a proguard-constructed jar file, which
I have a JarInputStream (constructed from a byte array which contains a JAR file)
I have a jar on the classpath which contains a hibernate.properties. This causes problems
I have Developed an Stand alone application (.jar) which is working on Linux environment,
I have a project, in which I want to invoke another Jar file in
I have a jar which contains all my core functionalities and a set of
I have a JAR file which is included in resources section of my JNLP

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.