[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
[Hibernate-JIRA] Created: (ANN-640) use property names defined in CompositeUserType as default column names
by Michael Newcomb (JIRA)
use property names defined in CompositeUserType as default column names
-----------------------------------------------------------------------
Key: ANN-640
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-640
Project: Hibernate Annotations
Issue Type: New Feature
Affects Versions: 3.3.0.ga
Reporter: Michael Newcomb
Priority: Minor
Consider:
public class LongitudeLatitude
{
protected double longitude;
protected double latitude;
}
public class LongitudeLatitudeCompositeUserType
implements CompositeUserType
{
public String[] getPropertyNames()
{
return new String[] { "longitude", "latitude" };
}
public Type[] getPropertyTypes()
{
return new Type[] { Hibernate.DOUBLE, Hibernate.DOUBLE };
}
...
}
@Entity
public class Test
{
@Basic(optional = false)
@Type(type = "foo.bar.LongitudeLatitudeCompositeUserType")
@Columns(columns = { @Column(name = "location_longitude"), @Column(name = "location_latitude") })
protected LongitudeLatitude location;
}
Why does the developer need to specify each column?
I'd really rather let the CompositeUserType take care of that for me. Now, I have to tie the @Columns to the # of properties in my CompositeUserType AND the order in which they are defined? This seems to defeat the purpose of having a class (CompositeUserType) to tell Hibernate how to store it.
Couldn't Hibernate prepend the property name 'location' and '_' to the front of each property name in the CompositeUserType?
Perhaps (more than likely) I'm doing something wrong, but I get a failure if I do not specify the columns.
Thanks,
Michael
--
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
[Hibernate-JIRA] Created: (HHH-2965) When using Criteria.setResultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP) method aliases need to be optional
by Ittai Zeidman (JIRA)
When using Criteria.setResultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP) method aliases need to be optional
----------------------------------------------------------------------------------------------------------------------
Key: HHH-2965
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2965
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.2
Environment: 3.2.2 Oracle 10G
Reporter: Ittai Zeidman
Priority: Critical
now when using the CriteriaSpecification- ALIAS_TO_ENTITY_MAP the convertion to map is using the aliases array, if it does not find an alias for the property it is not included in the map. I think that if no alias is defined then the propertyName attribute needs to be assigned as the key for the value in the hashmap.
I came across this issue as i have many mapped entities in my system and when using projections i need to use the resultTransformer. this is critical as when using aliases it is duplicated not only to the select clause but to the where clause only which is another open bug (#HB-1331). If one bug is closed then the other can be considered as minor as i can give aliases to every property i need if it does not affect my where clause.
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2738) Eager fetch support for StatelessSession
by Christian Bauer (JIRA)
Eager fetch support for StatelessSession
----------------------------------------
Key: HHH-2738
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2738
Project: Hibernate3
Issue Type: Task
Components: core
Reporter: Christian Bauer
class Node {
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "PARENT_NODE_ID", nullable = true)
protected Node parent;
}
StatelessSession ss = getStatelessSession();
Node node = (Node) ss.get(Node.class, nodeId);
[testng] org.hibernate.AssertionFailure: possible non-threadsafe access to the session
[testng] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:100)
[testng] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
[testng] at org.hibernate.loader.Loader.doQuery(Loader.java:729)
[testng] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
[testng] at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
[testng] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
[testng] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
[testng] at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3042)
[testng] at org.hibernate.impl.StatelessSessionImpl.get(StatelessSessionImpl.java:158)
[testng] at org.hibernate.impl.StatelessSessionImpl.get(StatelessSessionImpl.java:153)
[testng] at org.hibernate.impl.StatelessSessionImpl.get(StatelessSessionImpl.java:145)
--
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, 11 months