[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, 10 months
[Hibernate-JIRA] Created: (HHH-6344) IN expression misses negation when using row-value queries
by Isak Jonsson (JIRA)
IN expression misses negation when using row-value queries
----------------------------------------------------------
Key: HHH-6344
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6344
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.5
Environment: Using the PostgreSQL Dialect
Tested on 3.6.5 and 3.6.0 with the same result. Works on 3.2, but there actual row value native queries are used
Reporter: Isak Jonsson
Attachments: MyEntity.java, MyRowValue.java
The queries in the attached JPA entities behave differently regarding whether or not it is a row-value query.
Test code using the attached entities:
{noformat}
List<Integer> values1 = new LinkedList<Integer>();
List<MyRowValue> values2 = new LinkedList<MyRowValue>();
values1.add(1);
values1.add(2);
values2.add(new MyRowValue(3,4));
values2.add(new MyRowValue(5,6));
em.createNamedQuery("MyEntity.query1").setParameter("values", values1).getResultList();
em.createNamedQuery("MyEntity.query2").setParameter("values", values1).getResultList();
em.createNamedQuery("MyEntity.query3").setParameter("values", values2).getResultList();
em.createNamedQuery("MyEntity.query4").setParameter("values", values2).getResultList();
{noformat}
Results in the following SQL:
{noformat}
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a in (? , ?)
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a not in (? , ?)
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a=? and myentity0_.b=? or myentity0_.a=? and myentity0_.b=?
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a=? and myentity0_.b=? or myentity0_.a=? and myentity0_.b=?
{noformat}
(No "NOT" in the last line)
persistence.xml properties:
{noformat}
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.use_sql_comments" value="true"/>
{noformat}
Thanks for any insight to this!
--
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-5927) Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
by Strong Liu (JIRA)
Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
---------------------------------------------------------------------------------------------------------
Key: HHH-5927
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5927
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Strong Liu
Attachments: hotspot.png
with Order Demo (real-life simulation attempt test app) I have noticed that there is thread contention on createNamesQuery() which sounds suspicious.
After investigation it boils down to org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan. It serves as a cache (internal, not replacable) for queries using LRU algorithm (supplied from Apache utils).
Generally speaking, blocking threads in any sort of caches indicates a problem. From about 2000 calls, 700 got blocked (which is also not nice for context switching).
I guess, one of the problems is that there is exclusive synchronization in get method:
public synchronized Object get(Object key) {...}
which could be replaced by a more granular read-write lock.
org/hibernate/engine/query/QueryPlanCache.java
org/hibernate/util/SoftLimitMRUCache.java
--
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-6483) Add addJar() and addClassesFromPackage() to EntityManagerFactoryBuilder
by Ondra Žižka (JIRA)
Add addJar() and addClassesFromPackage() to EntityManagerFactoryBuilder
-----------------------------------------------------------------------
Key: HHH-6483
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6483
Project: Hibernate Core
Issue Type: New Feature
Components: entity-manager
Affects Versions: 4.0.0.next
Reporter: Ondra Žižka
JPA's persistence.xml has <jar-file> :
{code}
<persistence>
<persistence-unit name="TestPU">
<jta-data-source>java:/TestDS</jta-data-source>
<jar-file>foo/bar/entities.jar</jar-file>
</persistence-unit>
</persistence>
{code}
It would be fine to have Ejb3Configuration.addClassesFromJar() with the same effect.
Also, Ejb3Configuration.addClassesFromPackage() would be handy, which would find package-info.class and scan it's place (dir, jar, ...) for entities
(assuming a package is in one place only).
After HHH-6159, they would be EntityManagerFactoryBuilder.addClassesFromJar() and EntityManagerFactoryBuilder.addClassesFromPackage(), respectively.
Without this feature, users tend to hack their own scanning or use external lib like Scannotation, which is pitty since scanning code is already in Hibernate.
Thanks for considering.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 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, 10 months