[Hibernate-JIRA] Created: (HHH-4907) "id in ..." with EmbeddedId and criteria API fails on ms sql server
by Strong Liu (JIRA)
"id in ..." with EmbeddedId and criteria API fails on ms sql server
-------------------------------------------------------------------
Key: HHH-4907
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4907
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-CR-1
Environment: ms sql server
Reporter: Strong Liu
[http://hudson.qa.jboss.com/hudson/view/Hibernate%20Community/job/hibernat... ]
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2276)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at org.hibernate.test.annotations.cid.CompositeIdTest.testQueryInAndComposite(CompositeIdTest.java:306)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:156)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1373)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:371)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:322)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4003)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1550)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:160)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:133)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:265)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1832)
at org.hibernate.loader.Loader.doQuery(Loader.java:719)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2273)
... 32 more
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-2280) Not-Null Constraint-Violation with unidirectional one-to-many mapping
by Robert Herschke (JIRA)
Not-Null Constraint-Violation with unidirectional one-to-many mapping
---------------------------------------------------------------------
Key: HHH-2280
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2280
Project: Hibernate3
Type: Bug
Versions: 3.2.0.cr4
Environment: Hibernate 3.2.0.cr4, Oracle 10XE
Reporter: Robert Herschke
Priority: Blocker
Attachments: one-to-many-test.zip
In some cases it is neccessary to have an unidirectional one-to-many mapping, but not using Join-Tables due to a legacy database system.
So it must be possible, to have a one-to-many mapping just via a foreign-key-mapping. The Child-Object must not know the Parent-Object in this case.
It must also be possible, to pay respect to a NOT-NULL-Constraint at this foreign-key due to restrictions on legacy database systems.
Hibernate doesn't support this, but throw a NOT-NULL-Constraint Violation Exception. The documentation says, "this is unusual" - to which I want to dissent.
See the attached testcase for details, that is adopted from your "one-to-many" testcase found in the 3.2.0 sources.
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-4459) Query with Composite Primary Key parameter crashes when query cache is on
by Karol Bienkowski (JIRA)
Query with Composite Primary Key parameter crashes when query cache is on
-------------------------------------------------------------------------
Key: HHH-4459
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4459
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.3.2
Environment: Hibernate Core 3.3.2.GA, MySQL and H2
Reporter: Karol Bienkowski
I have an entity with a composite identifier (primary key) annotated with EmbeddedId:
@Embeddable
public class CompositeKey implements Serializable {
(...)
}
@Entity
public class EntityWithCompositeKey {
@EmbeddedId
public CompositeKey pk;
(...)
}
When executing query ...
FROM EntityWithCompositeKey e WHERE e.pk = :pk
... where ":pk" is bound to an instance of CompositeKey ...
query.setParamter("pk", new CompositeKey(..))
... I get the following exception:
javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of hhhxxxx.CompositeKey.a
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
at hhhxxxx.HHHHxxxxTest.testGetByCompositeId(HHHHxxxxTest.java:46)
(...)
Caused by: org.hibernate.PropertyAccessException: could not get a field value by reflection getter of hhhxxxx.CompositeKey.a
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:58)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:87)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:93)
at org.hibernate.tuple.component.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:109)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:376)
at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:194)
at org.hibernate.engine.TypedValue.hashCode(TypedValue.java:66)
at java.util.HashMap$Entry.hashCode(Unknown Source)
at java.util.AbstractMap.hashCode(Unknown Source)
at org.hibernate.cache.QueryKey.generateHashCode(QueryKey.java:196)
at org.hibernate.cache.QueryKey.<init>(QueryKey.java:173)
at org.hibernate.cache.QueryKey.generateQueryKey(QueryKey.java:128)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2144)
at org.hibernate.loader.Loader.list(Loader.java:2121)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
... 21 more
Caused by: java.lang.IllegalArgumentException: Can not set int field hhhxxxx.CompositeKey.a to [Ljava.lang.Object;
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.getInt(Unknown Source)
at sun.reflect.UnsafeIntegerFieldAccessorImpl.get(Unknown Source)
at java.lang.reflect.Field.get(Unknown Source)
at org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(DirectPropertyAccessor.java:55)
... 40 more
It used to work on 3.3.1.GA but fails in 3.3.2.GA. Turning off query cache works.
The direct reason for the error is that TypedValue.value is an Object[] but ComponentType.getHashCode() expects TypedValue.value to be of CompositeKey type.
I'll attach the working test case replicating the issue in a moment.
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-5209) org.hibernate.hql.ast.QuerySyntaxException when running a JPQL query with a MEMBER OF on an @ElementCollection
by Pascal Thivent (JIRA)
org.hibernate.hql.ast.QuerySyntaxException when running a JPQL query with a MEMBER OF on an @ElementCollection
--------------------------------------------------------------------------------------------------------------
Key: HHH-5209
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5209
Project: Hibernate Core
Issue Type: Bug
Components: core, entity-manager
Affects Versions: 3.5.1
Environment: Hibernate EM 3.5.1, HSQLDB, Derby, H2
Reporter: Pascal Thivent
Priority: Blocker
Attachments: QueryTest.patch
I have an entity with an attribute of type {{Set<String>}} annotated as {{@ElementCollection}}. Running a query with a {{MEMBER OF}} on this attribute fails with Hibernate (but works with the RI):
{code}
select user from User user where :role member of user.roles
{code}
This is valid JPQL but Hibernate is not able to generate the corresponding SQL properly:
{code:java}
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [select user from org.hibernate.ejb.test.User user where :role member of user.roles]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1222)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:271)
at org.hibernate.ejb.test.query.QueryTest.testMemberOfElementCollection(QueryTest.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.test.annotations.HibernateTestCase.runTest(HibernateTestCase.java:95)
at org.hibernate.test.annotations.HibernateTestCase.runBare(HibernateTestCase.java:83)
at org.hibernate.ejb.test.TestCase.runBare(TestCase.java:224)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [select user from org.hibernate.ejb.test.User user where :role member of user.roles]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
at org.hibernate.hql.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:244)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:205)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1761)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:268)
... 19 more
{code}
I'm not sure this would be the right place (this seems to be a problem in Hibernate Core actually) but I've implemented a test method in {{org.hibernate.ejb.test.query.QueryTest}} demonstrating the problem. The patch is attached.
--
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, 3 months
[Hibernate-JIRA] Created: (HSEARCH-269) Spell check functionality needed
by John Griffin (JIRA)
Spell check functionality needed
--------------------------------
Key: HSEARCH-269
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-269
Project: Hibernate Search
Issue Type: New Feature
Components: engine, mapping
Affects Versions: 3.2.0
Reporter: John Griffin
Assignee: John Griffin
>From Emmanuel:
- more than one field and even more than one index should be the source of the dictionary
- declaring which field is part of a dictionary should be declarative @AddToDictionary(name="main-dictionary")
(with probably an optional field name(s))
- for a given dictionary name, we need to associate an index and probably a field prefix (to share the same index
for all dictionaries). This couold be by annotations or in the configuration (not sure)
- this index should be kept like any other DirectoryProvider in the HSearch intrastructure (we could then reuse
ReaderProvider internally and don't have leaks).
- we will probably add a manual dictionary reindex method and the SpellChecker API should be in the SearchFactory.
sf.getDictionary("main-dictionary").spellcheck(word, suggestion);
sf.getDictionary("main-dictionary").spellcheck(word, suggestion, entity, properties...); //not sure how useful is this one really
sf.getDictionary("main-dictionary").reindex();
this needs to be refined.
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-4098) VARBINARY should be BLOB in DB2400Dialect
by Christian Luebke (JIRA)
VARBINARY should be BLOB in DB2400Dialect
-----------------------------------------
Key: HHH-4098
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4098
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.5.0.Beta-1
Environment: tested with hibernate 3.2.6ga, IBM DB2/400 on i5/os V5R4
Reporter: Christian Luebke
Priority: Minor
VARBINARY is registered in DB2Dialect (superclass of DB2400Dialect) as "varchar($l) for bit data". As DB2/400 (aka IBM DB2 for i) has a record length limitation of 32766 bytes, VARBINARY should be implemented as BLOB. Blobs are being stored outside the db record.
I successfully tried adding the following constructor in DB2400Dialect.java:
public DB2400Dialect() {
super();
registerColumnType( Types.VARBINARY, "blob($l)" );
}
As I'm not a hibernate user by myself, I can't provide a test case. I tried to get Bonita Workflow (http://www.bonitasoft.com/) to run with my DB2/400. It failed initially because of the usage of a 64 K varbinary. After patching DB2400Dialect to use a blob, everything worked fine.
--
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, 3 months