apache / apache/grails-core

Error read relationship hasOne an belong

Open
#14,475 5 comments 0 reactions 0 assignees View on GitHub
relates-to: grails-data-hibernate5
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

#10648
Task List

create a database with name "unabaseTest"

Steps to Reproduce

execute ./gradlew build for testing application

Expected Behaviour

The call of integration test to executing checkFather method of Pruebaservice and result expect shoul be a list with [1, 2] value, because the foreing key of class child are hija = 1 and hijaPol = 2

Actual Behaviour

but the list that return the service is [1,1] because is matching with ID of classes of child and no with foreing key

Environment Information

Operating System: ubuntu 16.04 LTS
Grails Version: 3.1.8.
JDK Version: jdk1.8.0_121
Container Version (If Applicable): Tomcat8
db mysql 5.7.8

Example Application
I will attachment a zip file with application for testing

Additional notes

When execute build the integration test run and you can see in reports th output.

BD
I will attachement image of db tables
![child2table](https://cloud.githubusercontent.com/assets/8511038/26581972/5afdc0ce-453f-11e7-9a66-97df8d97cc3c.jpg)
![fathertable](https://cloud.githubusercontent.com/assets/8511038/26581971/5afbff32-453f-11e7-8eba-494b0a32c999.jpg)
![tablechild](https://cloud.githubusercontent.com/assets/8511038/26581973/5b00a6e0-453f-11e7-9739-ae2ed7a533ae.jpg)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing issue #10648, the Pruebaservice checkFather method, and the integration test run by ./gradlew build. Reproduce the result with the attached application and MySQL schema; done means the relationship returns [1, 2] from the foreign-key values instead of [1, 1] from child IDs.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, mysql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.