[Hibernate-JIRA] Created: (HSEARCH-599) Hibernate cannot correctly load Locale in a @EmbeddedId key
by Smallufo Huang (JIRA)
Hibernate cannot correctly load Locale in a @EmbeddedId key
-----------------------------------------------------------
Key: HSEARCH-599
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-599
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.2.1
Environment: hibernate-3.5.6 , hibernate-search-3.2.1 , lucene-2.9.3 , Spring-3.0.4
Reporter: Smallufo Huang
The whole description (with pretty code formatting) is in this thread : http://stackoverflow.com/questions/3825729/hibernate-search-unable-to-loa...
To make it clear , I found an @EmbeddedId cannot correctly load Locale property!
Suppose I have an @EmbeddedId with an integer and a locale , composing a composite primary key.
And if the locale column in DB is storing "zh_TW" , it should build a Locale("zh" , "TW") object , with language=zh , country=Taiwan.
But the loaded locale is language="zh_tw" , without country value! It will invalidate the equals()/hashCode() contract.
And lucene will log "Object found in Search index but not in database" !
But if I remove the @EmbeddedId and use a surrogate key , the locale can be loaded correctly !
So it is a bug , but I am not sure it is from hibernate or hibernate-search.
--
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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-5605) Conflicting aliases when properties have same name and different types in inheritance.
by Ludger Springmann (JIRA)
Conflicting aliases when properties have same name and different types in inheritance.
--------------------------------------------------------------------------------------
Key: HHH-5605
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5605
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6, DB2 9.5 LUW on Solaris
Reporter: Ludger Springmann
Attachments: TestCase.zip
A Hql-Query leads to a DB2 Error (Error-Code -415). This happens with the following mapping:
In the sample testcase - that I added - there is an abstract superclass (AEntity) with two subclasses (BEntity, CEntity). BEntity has two numeric fields A and B. CEntity has two string fields B and C. When querying the HQL "from hibernate.testcase.inheritance.AEntity" this leads to the DB2-Error -415 (SQL0415N The data types of corresponding columns are not compatible in a fullselect that includes a set operator or in the multiple rows of a VALUES clause of an INSERT or fullselect.).
Here is the resulting SQL:
select aentity0_.Oid as Oid0_, aentity0_.A as A1_, aentity0_.B as B1_, aentity0_.B as B2_, aentity0_.C as C2_, aentity0_.clazz_ as clazz_ from ( select B, nullif('x','x') as C, Oid, A, 1 as clazz_ from springma.B union all select B, C, Oid, nullif(0,0) as A, 2 as clazz_ from springma.C ) aentity0_
In the union all both columns B are mapped into the same selection column. This is a type conflict.
--
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
15 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1566) SchemaValidator Complains about Oracle Date Columns
by Mathias Arens (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1566?page=c... ]
Mathias Arens commented on HHH-1566:
------------------------------------
A workaround would be to set in the column annotation the columnDefition attribute to 'DATE'. The the validator does not complain anymore.
{code:Java}
@Column(name = "VALID_UNTIL", columnDefinition="DATE")
private Date validUntil;
{code}
This worked in my case (Hibernate 3.5.5-Final) very well.
> SchemaValidator Complains about Oracle Date Columns
> ---------------------------------------------------
>
> Key: HHH-1566
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1566
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.1
> Environment: Hibernate 3.1.1, Annotations 3.1B8, EntityManager 3.1B6, Oracle 10g
> Reporter: Keenan Ross
>
> In the EJB3 Persistence forum, http://forum.hibernate.org/viewtopic.php?t=956307#2295709, Emmanuel suggested submit a bug report for this issue:
> The SchemaValidator objects to a Oracle column declared with the DATE datatype and annotated as TemporalType.TIMESTAMP.
> The SchemaValidator complains:
> javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: LAST_UPDATE, expected: timestamp
> on a persistent property declared as
> @Column(name="LAST_UPDATE", unique=false, nullable=false, insertable=true, updatable=true, length=7)
> @Temporal(TemporalType.TIMESTAMP)
> public Date getLastUpdate() {
> return this.lastUpdate;
> }
> with DDL
> CREATE TABLE plate (..., last_update DATE NOT NULL, ...)
> In Oracle, the DATE datatype contains both date and time information, much like java.lang.Date, so a TIMESTAMP temporal type should be a valid mapping. Indeed it is the only valid mapping, because while attempts to use TemporalType.DATE or TemporalType.TIME in the above example pass the SchemaValidator, they yeild Java Dates that contain only the date or time portions, respectively.
> From a brief review of the Hibernate code, it seems that each Dialect maps to an appropriate type, potentially out of several, while the validator thinks that is the only valid mapping.
> --keenan
--
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
15 years, 6 months