[Hibernate-JIRA] Created: (METAGEN-81) @Embeddable entities don't inherit the access type if it comes from the hierarchy of the containing class
by Guillaume Smet (JIRA)
@Embeddable entities don't inherit the access type if it comes from the hierarchy of the containing class
---------------------------------------------------------------------------------------------------------
Key: METAGEN-81
URL: https://hibernate.onjira.com/browse/METAGEN-81
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.2.0.Final, 1.1.1.Final
Environment: Hibernate 4.1.1, PostgreSQL 9.1
Reporter: Guillaume Smet
Assignee: Hardy Ferentschik
This is a followup from my post on the mailing list: we have @OneToOne relations on an @Embeddable object and they aren't present in the metamodel class generated for the @Embedded object.
After a couple of hours of debugging/digging, I came to the conclusion that this is due to a missing updateEmbeddableAccessType() call in TypeUtils.determineAccessTypeForHierarchy(): if the containing class doesn't contain any information for the access type, the hierarchy of the containing class is scanned for access type information. Due to this missing call, in this specific case, the access type is not propagated to the @Embeddable entity via the @Embedded link. If by any chance, your @OneToOne annotations are on the methods in your @Embeddable entities, they are taken into account as it's the default access type. If they are positioned on the fields, they are ignored even if your @Id annotation is positioned on a field in the hierarchy.
Pull request with a test case and the patch to follow.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-2548) when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
by Yu Deng (JIRA)
when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
--------------------------------------------------------------------------------------------------------------------
Key: HHH-2548
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2548
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.3
Environment: tomcat 5.5, eclipse3.2, jre1.5, postgreSQL8.1, hibernate3 and hibernate3.2
Reporter: Yu Deng
Priority: Critical
<hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
<class name="InvItem">
<id name="id" column="id">
<generator class="hilo"/>
</id>
...
<many-to-one name="transferredDetails"/> <!-- FK: Points to corresponding entry for transferred inventory items -->
....
</class>
(another mapping file)
</hibernate-mapping>>
<hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
<class name="InvTransferDetails" >
<id name="id" column="id">
<generator class="hilo"/>
</id>
<property name="returnedToICBC" type="com.grapevinecs.ams.dao.BooleanInteger" not-null="true"/>
...
</class>
</hibernate-mapping>
Probelm:
1) The result returns 3000 records ---- select count(*) from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
2) result List return size 0 by this query --- from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
1) is correct but 2) is not correct. only when transferredDetails in InvItem not null be returned. in case 2), I have no transferredDetails not null.
after I excuted the query 2), even I remove "c.transferredDetails.returnedToICBC asc", the result is still return nothing.
--
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
12 years, 9 months