[Hibernate-JIRA] Created: (HHH-6953) Envers: ManyToOne association returns null for audited entities when insertable/updatable=false
by Steffen Ryll (JIRA)
Envers: ManyToOne association returns null for audited entities when insertable/updatable=false
-----------------------------------------------------------------------------------------------
Key: HHH-6953
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6953
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.6.9, 4.0.0.Final
Environment: Hibernate Core/Envers 3.6.9 and 4.0.0.Final, HSQLDB 2.2
Reporter: Steffen Ryll
Attachments: envers-one2many-insertupdatefalse-bug_20120109.zip
We found a problem retrieving historical revisions of entities when there is a OneToMany association involved. Going from the one side to the many side always returns null. However, if I load that association through the normal entity manager, it is non-null (correctly).
I have created a tiny test case (see attachment) that demonstrates the effect.
The special twist is that removing the (insertable=false, updatable=false) parameters to the @JoinColumn annotation in Piece.java makes it work. But we do need those two options in our real project and removing them is no option.
I will start looking into the Envers code and try tracking down the reason for that NullPointerException, but wanted to have a bug report created in the first place.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-6812) HQL query for map value leads to incorrect joins in SQL
by Neukomm (JIRA)
HQL query for map value leads to incorrect joins in SQL
-------------------------------------------------------
Key: HHH-6812
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6812
Project: Hibernate Core
Issue Type: Bug
Components: query-hql, query-sql
Affects Versions: 3.6.7
Environment: Oracle Java 1.6.0_29, Hibernate 3.6.7-Final, Hsqldb 2.2.5
Reporter: Neukomm
Attachments: map_query_test.zip
Whenever an expression like 'where p.map['key'] = :val' is used in HQL, the join between the entity table and the map value table is not done correctly. This leads to missing results.
The attached test case uses HQL like this:
from MapQueryEntity p where p.name = 'B' or p.map['key'] = 'value'
the corresponding sql looks like this:
select
mapqueryen0_.id as id0_,
mapqueryen0_.name as name0_
from
MapQueryEntity mapqueryen0_ cross
join
MapQueryEntity_map map1_
where
mapqueryen0_.id=map1_.ident
and map1_.mkey = 'key'
and (
mapqueryen0_.name='B'
or map1_.mvalue='value'
)
This leads to all entities that don't have a map entry for key 'key' not to be in the result,
even if they have name 'B'.
SQL that would return the correct rows (at least on hsqldb) could e.g. look like this:
select
mapqueryen0_.id as id0_,
mapqueryen0_.name as name0_
from
MapQueryEntity mapqueryen0_
left outer join
MapQueryEntity_map map1_
on mapqueryen0_.id=map1_.ident
where
mapqueryen0_.name='B'
or (map1_.mkey = 'key' and map1_.mvalue='value')
Looks like org.hibernate.hql.ast.tree.IndexNode (which seems to be responsible for the hql/sql translation if '[]' is used) doesn't work correctly for this case.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HHH-6942) Envers Collection revision entries don't include deletes on detached entity saveOrUpdate
by Karl Walsh (JIRA)
Envers Collection revision entries don't include deletes on detached entity saveOrUpdate
----------------------------------------------------------------------------------------
Key: HHH-6942
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6942
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.6.8
Reporter: Karl Walsh
Attachments: TestCase.zip
Please see http://community.jboss.org/thread/175787?tstart=0
When a detached entity has some children removed by replacing the collection of children with a smaller collection, the audit entries do not contain the deletes when performing a saveOrUpdate. Using merge does include the correct delete revisions.
e.g
Parent contains children Child(A) and Child(B)
Parent -> (ChildA, ChildB)
If this collection is replaced with a new collection:
Parent -> (ChildA)
And a saveOrUpdate is issued on the parent, the audit entries doesn't include the delete for ChildB.
However, if the child is explicitly removed from the collection:
Parent.getChildren().remove(ChildB)
The saveOrUpdate works as expected and the delete of ChildB is audited correctly.
Using merge instead of saveOrUpdate allows the collection of children to be replaced rather than an explicit removal, and audit entries correctly register the delete of ChildB.
I have not tested this beyond 3.6.8.Final.
I have attached a spring/maven test case. Any questions let me know.
Karl
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months
[Hibernate-JIRA] Created: (HV-546) LazyValidatorFactory does not allow alternative bean validation providers
by Hardy Ferentschik (JIRA)
LazyValidatorFactory does not allow alternative bean validation providers
-------------------------------------------------------------------------
Key: HV-546
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-546
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Final
Reporter: Hardy Ferentschik
Fix For: 4.3.0.next
The current implementation of _LazyValidatorFactory_ does not allow alternative validation providers. The idea of the class is to make sure that Hibernate Validator is the default (it should be the first returned), but it should also allow for custom providers. For this to work logic as in _Validation#DefaultValidationProviderResolver_ is needed.
The same problem applies to _org.jboss.as.ee.beanvalidation.LazyValidatorFactory_ and _org.jboss.as.jpa.validator.JPALazyValidatorFactory_.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 8 months