[Hibernate-JIRA] Created: (BVAL-245) Define how method constraints are declared at parameters and return values
by Gunnar Morling (JIRA)
Define how method constraints are declared at parameters and return values
--------------------------------------------------------------------------
Key: BVAL-245
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-245
Project: Bean Validation
Issue Type: Sub-task
Components: spec-general
Reporter: Gunnar Morling
Fix For: 1.1
Emmanuel:
{quote}
Constraints on parameters whose type is a subtype of the accepted types by the constraint are declared directly on the parameter
void doHarm(@NotEmpty String kittenName);
Constrains on parameters whose type is a constrained bean needs an annotation accepting the targeted groups. It was proposed to use @Valid for such case but [recent discussions|https://hibernate.onjira.com/browse/BVAL-208?focusedCommentId...] brought that back on the drawing board.
There are a few notions floating around @Valid
1. cascade validation to nested beans
2. translate the validation of group A from the owning bean to validation of the group B on the nested bean (see BVAL-208)
3. define the group to validate in a method level validation
About 3., I wonder if this should be part of Bean Validation or be part of the interception framework. In other words:
* should it be an annotation provided / proposed by Bean Validation and recognized by interception techs like CDI, @Inject, Spring, AspectJ etc
* should each interception tech provide its own annotation to specify the targeted group(s)
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[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
14 years, 1 month
[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
14 years, 1 month
[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
14 years, 1 month
[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
14 years, 1 month