[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6381?page=c...
]
Hardy Ferentschik updated HHH-6381:
-----------------------------------
Description:
When using a _@SecondaryTable(name="xx")_, set to optional using
_(a)org.hibernate.annotations.Table(name="xx",optional=true)_ the documentation
states that the secondary table row will only be populated if any one of the properties
mapped to the secondary table are not-null. However, this does not work with joined
subclasses using the _JoinedSubclassEntityPersister_. This is because, internally, the
boolean which controls "outer joinability" (called _isNullableTable_) always
returns _false_.
A fix has been tested which will be put into a github pull request.
The fix implements _isNullableTable_ to honor the optional flag.
Unfortunately, there is no way I could find to really test whether the code is working, as
it requires examining the SQL generated for various operations. However, I have manually
verified the fix. Please look at the output of the _JoinedSubclassAndSecondaryTable_
test, which has been modified as well, to verify the DML statements.
Fix available for 3.6.5 upon request. github pull will be for 4.0 (master).
was:
When using a @SecondaryTable(name="xx), set to optional using
@org.hibernate.annotations.Table(name="xx",optional=true) the documentation
states that the secondary table row will only be populated if any one of the properties
mapped to the secondary table are not-null. However, this does not work with joined
subclasses using the JoinedSubclassEntityPersister. This is because, internally, the
boolean which controls "outer joinability" (called isNullableTable) always
returns false.
A fix has been tested which will be put into a github pull request.
The fix implements isNullableTable to honor the optional flag.
Unfortunately, there is no way I could find to really test whether the code is working, as
it requires examining the SQL generated for various operations. However, I have manually
verified the fix. Please look at the output of the JoinedSubclassAndSecondaryTable test,
which has been modified as well, to verify the DML statements.
Fix available for 3.6.5 upon request. github pull will be for 4.0 (master).
using @SecondaryTable with optional=true not handled for joined
subclasses (@Inheritance(strategy = InheritanceType.JOINED)
---------------------------------------------------------------------------------------------------------------------------
Key: HHH-6381
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6381
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.5, 4.0.0.Beta2
Environment: linux, jdk 1.6, hibernate latest from master, oracle 11gr2
Reporter: David Mansfield
When using a _@SecondaryTable(name="xx")_, set to optional using
_(a)org.hibernate.annotations.Table(name="xx",optional=true)_ the documentation
states that the secondary table row will only be populated if any one of the properties
mapped to the secondary table are not-null. However, this does not work with joined
subclasses using the _JoinedSubclassEntityPersister_. This is because, internally, the
boolean which controls "outer joinability" (called _isNullableTable_) always
returns _false_.
A fix has been tested which will be put into a github pull request.
The fix implements _isNullableTable_ to honor the optional flag.
Unfortunately, there is no way I could find to really test whether the code is working,
as it requires examining the SQL generated for various operations. However, I have
manually verified the fix. Please look at the output of the
_JoinedSubclassAndSecondaryTable_ test, which has been modified as well, to verify the DML
statements.
Fix available for 3.6.5 upon request. github pull will be for 4.0 (master).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira