[Hibernate-JIRA] Commented: (HHH-746) Criteria query on "class" property
by Andrew Ebaugh (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-746?page=co... ]
Andrew Ebaugh commented on HHH-746:
-----------------------------------
In what version was this fixed? I'm using 3.2.0ga and I still see an issue with making Criteria queries referencing an associated property type.
When I create Criterion like so:
Expression.eq("associatedproperty.class", MySublcassProperty.class)
it's close, but does not work the same as a HQL query with "... where associatedproperty.class = MySubclassProperty"
In this example, the discriminator value for the entity MySubclassProperty is MP. The call to getDiscriminatorSQLValue() in CriteriaQueryTranslator.getTypedValue returns 'MP', which ends up in the resultant SQL query as '\'MP\'', i.e. with the apostrophes escaped within another set of apostrophes.
I wrote a workaround that is not particularly pretty, but will strip off the leading/trailing apostrophes. It can be used as follows, in place of the Expression.eq call above:
new TypeEqualityExpression("associatedproperty.class", MySublcassProperty.class)
> Criteria query on "class" property
> ----------------------------------
>
> Key: HHH-746
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-746
> Project: Hibernate3
> Issue Type: Improvement
> Components: core
> Environment: 3.06, Oracle
> Reporter: Cuong Tran
> Assignee: Joshua Davis
> Priority: Minor
> Time Spent: 1 hour
> Remaining Estimate: 0 minutes
>
> Currently, when using the "class" property on Criteria query, hibernate doesn't translate the value into the underlying discriminator. See the discussion/test case here:
> http://opensource.atlassian.com/projects/hibernate/secure/CreateIssue.jspa
--
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
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2759) hibernate 3.2.5 local resultset list didn't get refresh
by Tiffany Hsu (JIRA)
hibernate 3.2.5 local resultset list didn't get refresh
-------------------------------------------------------
Key: HHH-2759
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2759
Project: Hibernate3
Issue Type: Bug
Components: caching (L2), core
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5, Ehcache1.3, spring2.0 and jboss4.2.1
Reporter: Tiffany Hsu
when I update a status to a current data using hibernate saveOrUpdate().
I retrieve data (find) from the same table and bring back to a resultlist which contained the old data.
The updated data is still in the list.
It works in 3.1the status was updated and it is not in the resultlist after select (find)
3.2.X the updated data still in the resultlLst after another select (find) utile I manually reload the page.
daoCustomerContent is a hibernate data object
customerContent.setCustomerContentStatus(
CustomerContentStatusEnum.SUBMITTED);
daoCustomerContent.save(customerContent);//save locally in the hibernate
fgetHibernateTemplate().executeFind(
new Page(_queryString, _values, _page, _pageSize)); // the update data after .save still exist in this result List
--
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
17 years, 5 months