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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:14:25+00:00 2026-05-22T18:14:25+00:00

The following query doesn’t return any rows List remedies = session.createQuery(from Remedy).list(); No errors,

  • 0

The following query doesn’t return any rows
List remedies = session.createQuery(“from Remedy”).list();
No errors, but nothing in the remedies list and there are rows in the table.

What I have is 2 tables: remedy and remedyTranslation
I have the following map files:
remedy.hbm.xml is below:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
  <class name="com.audiClave.Service.Remedy" table="REMEDY">
    <id column="REMEDY_ID" name="remedy_id" type="int">
      <generator class="native"/>
    </id>
    <property generated="never" lazy="false" name="name">
      <column name="NAME"/>
    </property>
    <set 
        name="remedyTranslations" 
        lazy="true"
        inverse="true"
        cascade="save-update">
  <key column="REMEDY_ID"/>
  <one-to-many class="com.audiClave.Service.RemedyTranslation"/>
    </set>
  </class>
</hibernate-mapping>

remedyTranslation.hbm.xml is below:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.audiClave.Service.RemedyTranslation" table="REMEDYTRANSLATION">
    <id column="REMEDYTRANSLATION_ID" name="remedyTranslation_id" type="int">
        <generator class="native"/>
    </id>
    <many-to-one 
        name="remedy_id" 
        column="REMEDY_ID" 
        class="com.audiClave.Service.Remedy" 
        not-null="true"
        lazy="false" />
    <property generated="never" lazy="false" name="name">
        <column name="NAME"/>
    </property>
    <property generated="never" lazy="false" name="language">
        <column name="LANGUAGE"/>
    </property>
</class>
</hibernate-mapping>

hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
     "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
     "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 <session-factory>
  <!-- Database connection settings -->
  <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="connection.url">jdbc:mysql://localhost/userdata</property>
  <property name="connection.username">mysql</property>
  <property name="connection.password">???????</property>

  <!-- JDBC connection pool (use the built-in) -->
  <property name="connection.pool_size">1</property>

  <!-- SQL dialect -->
  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>

  <!-- Enable Hibernate's automatic session context management -->
  <property name="current_session_context_class">thread</property>

  <!-- Disable the second-level cache -->
  <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

  <!-- Echo all executed SQL to stdout -->
  <property name="show_sql">true</property>

  <!-- Drop and re-create the database schema on startup -->
  <property name="hbm2ddl.auto">update</property>

  <!-- Mapping files -->
  <mapping resource="remedy.hbm.xml"/>
  <mapping resource="remedyTranslation.hbm.xml"/>

 </session-factory>
</hibernate-configuration>
  • 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-22T18:14:26+00:00Added an answer on May 22, 2026 at 6:14 pm

    If what andrew posted doesn’t work, turn your hibernate logging on to show sql statements and see if you are actually making any sql requests. If there are no requests, the problem lies in your configuration, if there is a bad request then you’ll know it’s in your class.

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

Sidebar

Related Questions

The following query works on Oracle 10.2.0.1.0 on windows,but doesn't work on Oracle 10.2.0.2.0
Why would the following query return Error converting data type varchar to bigint? Doesn't
Why does the following query return 'zero' records: SELECT * FROM records WHERE rownum
Hi I've got the following query but it doesn't seem to work. $q =
I have the following SQL query but it doesn't entirely work because it shows
I tried the following query but it doesn't give the answer that I need
I don't know why following query doesn't work: //a/@href[@class='specified_string']
Is there a reason why this query doesn't work? The following query will work
Does anyone know why the following query fails in Derby? delete from MyTable where
I'm trying to execute the following query but I receive a runtime error stating

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.