[Hibernate-JIRA] Created: (HBX-1065) Named Query DAO methods with Primitive types fail to compile with JDK 1.4
by Joe Porcheddu (JIRA)
Named Query DAO methods with Primitive types fail to compile with JDK 1.4
-------------------------------------------------------------------------
Key: HBX-1065
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1065
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.2.0.GA
Reporter: Joe Porcheddu
Attachments: hbx469.zip
This is the same issue as HBX-469, but I was asked to create a new case and attach my test case. Please see attached Eclipse/Maven project.
The problem is that if a named query with a type of "java.lang.Long" or "java.lang.Integer" exists in an HBM file, then the Hbm2Dao task converts it to a primitive long. This causes the compile to fail if you are using JDK 1.4.
For example:
<query name="findBySomeLong">
<query-param name="someLong" type="java.lang.Long" />
from Hbx469 where someLong=:someLong
</query>
when run through hbm2dao generates the following code:
public List findBySomeLong(long someLong) {
Query query = sessionFactory.getCurrentSession()
.getNamedQuery("Hbx469.findBySomeLong");
query.setParameter("someLong", someLong);
return query.list();
}
You will get a compile error on query.setParameter() when using JDK 1.4 because the java.lang.Long has been generated as a Java primitive long.
--
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
17 years, 9 months
[Hibernate-JIRA] Created: (HBX-1067) [SchemaExport] Duplicate unique constraint with unique="true" and natural-id
by Vincent Ricard (JIRA)
[SchemaExport] Duplicate unique constraint with unique="true" and natural-id
----------------------------------------------------------------------------
Key: HBX-1067
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1067
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.0.GA
Environment: Hibernate 3.2.5, MySQL 5.0.51 (InnoDB), Java 1.5
Reporter: Vincent Ricard
Priority: Minor
In my foo.hbm.xml, if i put this:
<natural-id>
<property name="barId" column="bar_id" not-null="true" length="128"/>
</natural-id>
SchemaExport creates this:
create table foo (id bigint not null auto_increment, version integer not null, bar_id varchar(128) not null, primary key (id), unique (bar_id)) ENGINE=InnoDB;
And MySQL creates only one index for bar_id.
But, if my foo.hbm.xml contains this:
<natural-id>
<property name="barId" column="bar_id" not-null="true" unique="true" length="128"/>
</natural-id>
SchemaExport generates this:
create table foo (id bigint not null auto_increment, version integer not null, bar_id varchar(128) not null unique, primary key (id), unique (bar_id)) ENGINE=InnoDB;
And MySQL creates 2 indices for bar_id.
So, i think it'd be cool if schemaexport was smarter (even if MySQL could be too).
--
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
17 years, 9 months
[Hibernate-JIRA] Created: (HSEARCH-212) Added a new very efficient ReaderProvider
by Sanne Grinovero (JIRA)
Added a new very efficient ReaderProvider
-----------------------------------------
Key: HSEARCH-212
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-212
Project: Hibernate Search
Issue Type: Improvement
Components: directory provider
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Creating a new ReaderProvider, it should be faster and more scalable compared to the current ones.
Here are some numbers on a little 9MB index; it should improve on bigger indexes:
(SharingBufferReaderProvider is the name it had during tests)
using 100 threads:
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 34735ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 34396ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 37347ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 36895ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 36100ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 42433ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 44830ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 40704ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 43685ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 50452ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 48171ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 52862ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 49999ms. (20000 searches, 1000 insertions, 2000 updates)
20 Threads:
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 31133ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for org.hibernate.search.reader.SharingBufferReaderProvider: 31408ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 38170ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for shared: 36327ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 41712ms. (20000 searches, 1000 insertions, 2000 updates)
Performance test for not-shared: 42224ms. (20000 searches, 1000 insertions, 2000 updates)
--
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
17 years, 9 months