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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:19:04+00:00 2026-06-11T02:19:04+00:00

I am new to Hibernate. Recently, I was trying simple example to connect my

  • 0

I am new to Hibernate. Recently, I was trying simple example to connect my UI with Database using Spring and Hibernate.

I am able to successfully call a method to fetch the data through my controller, service etc using REST.
But I am encountering below error,whenever I run the application.
Here “Feedback” is the name of Table in Database as well as the same name of my Pojo Java class.

Note : Giving different names to table and Java class also results in same error.

org.springframework.orm.hibernate3.HibernateQueryException: Feedback
is not mapped [from Feedback]; nested exception is
org.hibernate.hql.ast.QuerySyntaxException: Feedback is not mapped
[from Feedback]

Java Pojo:-

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

@Entity
@Table(name="Feedback")
public class Feedback {
    private int id;
    private String title;
    private String content;
    private String name;

    @Id
    @GeneratedValue
    @Column(name="id")
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }

    @Column(name="title", nullable=false)
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name="content", nullable=false)
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }

    @Column(name="name", nullable=false)
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Override
    public String toString() {
        return "Feedback [id=" + id + ", title=" + title + ", content="
                + content + ", name=" + name + "]";
    }
}

FeedbackDAO :-

@Repository
public class FeedbackDAO implements IFeedbackDAO {

    private HibernateTemplate hibernateTemplate;

    public HibernateTemplate getHibernateTemplate() {
        return hibernateTemplate;
    }

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    @SuppressWarnings("unchecked")
    public List<Feedback> getFeedbackList() {

       // This line causes that error.
        return hibernateTemplate.find("from Feedback");

    }
       ...
       ...
}

Configuration made in db-config.xml

 <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory"><ref local="sessionFactory"/></property>
    </bean>

What could be causing this ?

Do am I missing something here ?

Thanks

  • 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-11T02:19:05+00:00Added an answer on June 11, 2026 at 2:19 am

    You might have missed a thing in sessionFactory definition.

    <bean id="sessionFactory" ...>
        ...
        <property name="annotatedClasses">
            <list>
                <value><java package name here>.Feedback</value>
            </list>
        </property>
        ...
    </bean>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've got a simple web application using Spring MVC + Hibernate and am
I am new to hibernate and I am stumped. In my database I have
I am new to hibernate queries, and trying to get a grasp on how
I'm have a lot of time using hibernate (JPA) in java, but i recently
I recently started using LINQ to SQL in my database later for a C#
I'm currently using Spring and Hibernate. At the moment, if I make a create
I have recently added a new column (age) to a database table (user). I
I am new to Hibernate. I create a simple program to insert values to
I'm new to Hibernate. I've created a database with several tables and imported it
Recently i am started using hibernate. to insert or update i am using saveOrUpdate()

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.