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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:15:54+00:00 2026-05-11T17:15:54+00:00

I’m new to using Hibernate with Java. I’m getting the following exception. The stuff

  • 0

I’m new to using Hibernate with Java. I’m getting the following exception. The stuff that I found online regarding this error didn’t seem to help. Any ideas? The Exception:

java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: 

ApplPerfStats is not mapped [select count(c) from ApplPerfStats c]
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:601)
    at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:96)
    at com.icesoft.icefaces.samples.datatable.jpa.CustomerDAO.findTotalNumberCustomers(CustomerDAO.java:89)
    at com.icesoft.icefaces.samples.datatable.ui.SessionBean.getDataPage(SessionBean.java:189)
    at com.icesoft.icefaces.samples.datatable.ui.SessionBean.access$0(SessionBean.java:185)
    at com.icesoft.icefaces.samples.datatable.ui.SessionBean$LocalDataModel.fetchPage(SessionBean.java:245)
    at com.icesoft.icefaces.samples.datatable.ui.PagedListDataModel.getPage(PagedListDataModel.java:121)
    at com.icesoft.icefaces.samples.datatable.ui.PagedListDataModel.getRowCount(PagedListDataModel.java:100)
    at com.icesoft.faces.component.datapaginator.DataPaginator.isModelResultSet(DataPaginator.java:1091)
    at com.icesoft.faces.component.datapaginator.DataPaginatorRenderer.encodeBegin(DataPaginatorRenderer.java:201)

The place where this is called:

@SuppressWarnings("unchecked")
public Long findTotalNumberCustomers() {
    EntityManagerHelper.log("finding number of Customer instances", Level.INFO, null);
    try {
        String queryString = "select count(c) from ApplPerfStats c";
        return (Long) getEntityManager().createQuery(queryString).getSingleResult();
    } catch (RuntimeException re) {
        EntityManagerHelper.log("find number of Appl_perf_stats failed",
                Level.SEVERE, re);
        throw re;
    }
}

The class that maps to the database table:

package com.icesoft.icefaces.samples.datatable.jpa;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "Appl_perf_stats", uniqueConstraints = {})
public class ApplPerfStats implements java.io.Serializable {
.....

Thanks,

Tam

  • 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-11T17:15:55+00:00Added an answer on May 11, 2026 at 5:15 pm

    Try adding a class element under persistence-unit, in your persistence.xml file.

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence ...>
    
        <persistence-unit name="unit">
            <class>com.icesoft.icefaces.samples.datatable.jpa.ApplPerfStats</class>
            ...
         </persistence-unit>
    <persistence>
    

    I haven’t done much more than that with JPA/EntityManager, so I don’t know if there’s a way to add an entire package. AFAIK, when using hibernate.cfg.xml, each persistent class has to be specified directly.

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

Sidebar

Ask A Question

Stats

  • Questions 211k
  • Answers 212k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The tests run on a single instance of your test… May 12, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer Here are some : SHJS highlight.js Prettify (As suggested by… May 12, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer First you should calculate what segments of the cutting line… May 12, 2026 at 10:15 pm

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.