Why Hibernate returns null while the same query in Postgres returns a row?

Description

I had a hard time to make my JUnit test working. Here are the code snippets. The first is my superclass:

Then there are two descendeants:

and

Here is an excerpt of the script, creating the DB in PostgreSQL:

And finally the test case^

The repo is

Now here is the log:

The question is: Why 190216.877 D main/JpaMealRepositoryImpl - m=null?

If I run this query in Postgres, replacing the ? with the meal_id (which is 4 as seen in the log), then I get a row. Just a single row as I wanted. Why em.find(...) returns null?

I fill the DB with the refill.sql script on start of each test-class:

Here is the qwery I issue in psql:

The result is

Environment

<version.hibernate>5.2.12.Final</version.hibernate>

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

MS Windows 10

PostgreSQL 10.1

Activity

Show:
Дани́с Тазеев
February 1, 2018, 8:56 PM

Hi Gail!

I'm attaching the ZIP with the test case, made according to the link you gave.
I have to state that the «BUG» doesn't reproduce on pure Hibrenate without Spring.
Frankly, I'm frustrated a bit now.

Find the attachment.
And thank you!

Gail Badner
February 2, 2018, 12:32 AM

, are you saying that you're attached test case does not reproduce the issue?

Дани́с Тазеев
February 2, 2018, 9:25 AM

@Gail Badner, yes, definitely. It looks like the Spring somehow influence Hibernate's working.

Gail Badner
February 8, 2018, 11:23 PM

, it sounds like a Spring bug. Have you opened an issue with Spring?

Дани́с Тазеев
February 10, 2018, 2:08 PM

@Gail Badner, yes, it does. No, I've not yet.

Assignee

Unassigned

Reporter

Дани́с Тазеев

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure