[Hibernate-JIRA] Created: (HHH-2620) Hibernate and Unicode
by Maneesh Chauhan (JIRA)
Hibernate and Unicode
---------------------
Key: HHH-2620
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2620
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.1.3
Environment: Window and Linux , Mysql 5.0
Reporter: Maneesh Chauhan
HI All ,
In My project i would like to insert the multiple language characters like chinese,japanese , Denmark etc . For this , i setup my mysql database with character set utf8 and in the hibernate configuration file connection url is like this
connection.url = jdbc:mysql://localhost/multibyte?useUnicode=true&characterEncoding=UTF-8
But when i am trying to insert the chinese characters in the database by using the hibernate then it shows ???? characters and i retrieve the same row from the database by using hibernate then i got the ????
Please let me know is there any more change should i will have to make to run the things smoothly
Thanks in advance
Maneesh Chauhan
--
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
16 years, 8 months
[Hibernate-JIRA] Updated: (HHH-957) SubqueryExpression throws ClassCastException on DetachedCriteria subqueries
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-957?page=co... ]
Diego Pires Plentz updated HHH-957:
-----------------------------------
Component/s: query-criteria
> SubqueryExpression throws ClassCastException on DetachedCriteria subqueries
> ---------------------------------------------------------------------------
>
> Key: HHH-957
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-957
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.0.5
> Environment: Oracle 9i, but probably not DB specific.
> Reporter: Rob MacGrogan
> Priority: Minor
> Attachments: subcriteria-patch.txt, SubqueryExpression.java, SubqueryExpression.java, SubqueryExpression.java
>
>
> The toSqlString() method in SubqueryExpression contains a line that casts a Criteria object to CriteriaImpl in order to call the getSession() method. However, if DetachedCriteria is used as a subquery in a Criteria query, the underlying Criteria object will be CriteriaImpl.Subcriteria, thus a ClassCastException will be thrown.
> I have created a bug fix. Add the following method to SubqueryExpression:
> private SessionImpl getSessionImpl(Criteria criteria) {
> SessionImpl session = null;
> if (criteria instanceof CriteriaImpl) {
> CriteriaImpl impl = (CriteriaImpl)criteria;
> session = impl.getSession();
> }
> else if (criteria instanceof CriteriaImpl.Subcriteria){
> CriteriaImpl.Subcriteria sub = (CriteriaImpl.Subcriteria)criteria;
> //Alert! Recursive call here!
> session = getSessionImpl(sub.getParent());
> }
> return session;
> }
> And then replace the offending line in toSqlString() with a call to the new method.
> Attached is SubqueryExpression with proposed changes in place.
--
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
16 years, 8 months