-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-9952 Formula in join columns lead to several errors #3761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
beikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look ok to me mostly, but there is a test failure. The test org.hibernate.test.subselect.CompositeIdTypeBindingTest fails on databases that support row value constructors, like e.g. PostgreSQL.
hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
Outdated
Show resolved
Hide resolved
hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java
Outdated
Show resolved
Hide resolved
beikov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good now, but there are still failures for DBs that support the row-value constructor syntax like e.g. PostgreSQL in the following test: org.hibernate.test.subselect.CompositeIdTypeBindingTest
|
Hi @beikov I'm working on that |
|
the issue should be fixed |
|
This looks like it might impact HR, need to look more closely. |
| return scalarColumnIndex; | ||
| } | ||
|
|
||
| protected static String[] extractMutationTexts(Node operand, int count) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have reason to use the combination of 'protected' + 'static'? I even googled for this: https://www.google.com/search?q=protected+static+java+method&rlz=1C5CHFA_enCA943CA943&oq=protected+static+java+method&aqs=chrome..69i57j0i22i30l3.4244j1j7&sourceid=chrome&ie=UTF-8
| } | ||
| String[] splits = StringHelper.split( ",", nodeText ); | ||
| if ( count != splits.length ) { | ||
| throw new HibernateException( "SqlNode's text did not reference expected number of columns" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest creating a complete exception with more detail, like:
throw new HibernateException( String.format("sqlNode's text did not reference expected number of columns (expecting: %d, actual: %d)", count, splits.length));
|
Was this abandoned? |
|
I created a test using annotation instead of the deprecated hbm mapping showing the issue has been resolved in recent Hibernate versions. |
https://hibernate.atlassian.net/browse/HHH-9952
This is a rebased version of #1013.
I have also applied some changes to the original PR :
AbstractCollectionPersister#columnNamesimplextractMutationTextsand moved it to theAbstractSelectExpression(not sure if this is the right place)I'm not entirely sure about the impact of the change to
AbstractEntityPersister#toColumns(String propertyName)