[Hibernate-JIRA] Created: (HBX-922) Error performing HQL completion when 'tab' characters are present
by Joseph Marques (JIRA)
Error performing HQL completion when 'tab' characters are present
-----------------------------------------------------------------
Key: HBX-922
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-922
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2beta10
Reporter: Joseph Marques
I'll get auto-completion for the "others" alias if I type:
SELECT a
FROM ObjectA AS a
JOIN a.others AS others
WHERE others.
However, I if put a tab just before the join:
SELECT a
FROM ObjectA AS a
<tab>JOIN a.others AS others
WHERE others.
Then I'll get an exception in the Error log:
java.lang.StringIndexOutOfBoundsException: String index out of range: 108
at java.lang.String.<init>(Unknown Source)
at java.lang.String.valueOf(Unknown Source)
at org.hibernate.tool.ide.completion.HQLAnalyzer.getSubQueries(HQLAnalyzer.java:206)
at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleSubQueries(HQLAnalyzer.java:130)
at org.hibernate.tool.ide.completion.HQLAnalyzer.getVisibleEntityNames(HQLAnalyzer.java:142)
at org.hibernate.tool.ide.completion.HQLCodeAssist.codeComplete(HQLCodeAssist.java:34)
at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeProposals(HQLCompletionProcessor.java:117)
at org.hibernate.eclipse.hqleditor.HQLCompletionProcessor.computeCompletionProposals(HQLCompletionProcessor.java:75)
at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1612)
...
I don't believe this was an issue back in beta8.
--
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, 1 month
[Hibernate-JIRA] Created: (HBX-923) Awkward auto-completion of entities that have composite primary keys
by Joseph Marques (JIRA)
Awkward auto-completion of entities that have composite primary keys
--------------------------------------------------------------------
Key: HBX-923
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-923
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2beta10
Reporter: Joseph Marques
Here is a primary key class:
class ObjectA_PK {
Object one;
Object two;
}
Here is an entity class
@entity
class ObjectA {
@Id Object one;
@Id Object two;
Object other;
Object stuff;
public ObjectA(ObjectA_PK pk) {
one = pk.one;
two = pk.two;
}
}
When I try to write a query using ObjectA and request auto-completion on the alias:
SELECT a
FROM ObjectA AS a
WHERE a. <-- auto-completion here
I get two types of responses:
1) The attributes actually found in ObjectA - "other" and "stuff"
2) A special thing labeled as "_identifierMapper"
When I continue using this special token:
SELECT a
FROM ObjectA AS a
WHERE a._identifierMapper. <-- auto-completion here
I get the values in my primary key class: "one" and "two"
But I don't want a query that has the special "_identifierMapper" in it, especially when it's unnecessary. I compared the following two queries:
SELECT a
FROM ObjectA AS a
WHERE a._identifierMapper.one
SELECT a
FROM ObjectA AS a
WHERE a.one
And they produced the exact same sql in the "Hibernate Dynamic SQL Preview" view. So, I guess it would be nice to see the primary key fields directly in the auto-completion list for the 'a' alias. Thus, for:
SELECT a
FROM ObjectA AS a
WHERE a. <-- auto-completion here
I want to see the list: 'one', 'two', 'other', and 'stuff'
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-2543) HQL
by Feng Gao (JIRA)
HQL
---
Key: HHH-2543
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2543
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.0.ga
Environment: windows, Netbeans
Reporter: Feng Gao
Priority: Critical
I use the following HQL and I got the sql below:
from Order o
where
o.caiman_status in (' ' NEW' , 'CAPUTRE_REQUEST' , 'REVERSAL_REQUEST' , 'REFUND_REQUEST')
or (o.caiman_status='AUTH_RETRY' and o.nextCallDate is not null) order by o.id asc
------------------------
Generated SQL:
------------------------
from
CM_ORDERS order0_
where
order0_.caimain_status in (
' NEW' , 'CAPUTRE_REQUEST' , 'REVERSAL_REQUEST' , 'REFUND_REQUEST'
)
or order0_.caimain_status='AUTH_RETRY' and ( order0_.next_call_date is not null ) //the bracket should start after 'or'
order by order0_.order_id asc
--
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, 1 month
[Hibernate-JIRA] Commented: (HHH-1961) Schema validation fails with floating point column in Oracle 10g
by Per Bergman (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1961?page=c... ]
Per Bergman commented on HHH-1961:
----------------------------------
I think the problem is that 'double precision' and 'float' are synonyms in Oracle.
The schema validator uses string comparison and tries to compare 'float...' with 'double...' which fails.
I created a simple Oracle10Dialect, and validation passes.
package some.package;
import java.sql.Types;
import org.hibernate.dialect.Oracle9Dialect;
public class Oracle10Dialect extends Oracle9Dialect {
public Oracle10Dialect() {
super();
registerColumnType( Types.DOUBLE, "binary_double" ); // maps with Java double
}
}
> Schema validation fails with floating point column in Oracle 10g
> ----------------------------------------------------------------
>
> Key: HHH-1961
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1961
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.2.0.cr2
> Environment: 3.2 CR 2, Oracle 10g express edition release 2, Windows XP service pack 2, JDK 1.5.0_06
> Reporter: Daniel Dyer
>
> I have a table (created automatically by Hibernate) for mapping a double field. The table creation from Ant works fine but when starting up JBoss with the hibernate.hbm2ddl.auto property set to validate, I get the following exception:
> Caused by: org.hibernate.HibernateException: Wrong column type: percentage, expected: double precision
> at org.hibernate.mapping.Table.validateColumns(Table.java:219)
> at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:965)
> at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:296)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:414)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:575)
> at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:245)
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:108)
> at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:260)
> ... 127 more
> Doing a "desc" on the table reveals that the column is of type FLOAT with a length of 22.
> I think this may be related to issue HHH-1566 or HHH-1008.
--
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, 1 month
[Hibernate-JIRA] Commented: (HHH-1501) Derby 10 varchar limit is 32672
by Brian J. Sayatovic (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1501?page=c... ]
Brian J. Sayatovic commented on HHH-1501:
-----------------------------------------
I've been trying to get XWiki (v1.0b6), which uses Hibernate, to run against Derby. However, the table creation is failing when large text columns are involved:
21:12:38,687 [http-80-Processor25] ERROR hbm2ddl.SchemaExport - Unsuccessful: create table XWIKI.xwikiattachment_archive (XWA_ID bigint not null, XWA_ARCHIVE varchar(4000000) for bit data, primary key (XWA_ID))
21:12:38,687 [http-80-Processor25] ERROR hbm2ddl.SchemaExport - The length, precision, or scale attribute for column, or type mapping 'VARCHAR (4000000) FOR BIT DATA' is not valid.
I believe this is caused by the very issue covered in this issue.
I mention this because the priority of this issue is 'trivial', so if evidence of an actual problem created by this bug can help raise this priroity, I've just offered one.
Mind you, I'm a HIbernate/Derby/XWiki novice, so I may be misunderstanding the problem.
> Derby 10 varchar limit is 32672
> --------------------------------
>
> Key: HHH-1501
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1501
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: Derby 10
> Reporter: Sergey Vladimirov
> Priority: Trivial
>
> Derby 10 varchar limit is 32672.
> One need to change DB2Dialect and DerbyDialect to create clob columns, if size of text > 32k:
> registerColumnType(Types.CHAR, 254, "char(1)");
> registerColumnType(Types.VARCHAR, 32672, "varchar($l)");
> registerColumnType(Types.VARCHAR, Integer.MAX_VALUE, "clob($l)");
> (BTW, char limit is 254).
--
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, 1 month
[Hibernate-JIRA] Commented: (HHH-1423) ParameterParser bug - ordinal parameter mismatch
by Juan Antonio Agudo (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1423?page=c... ]
Juan Antonio Agudo commented on HHH-1423:
-----------------------------------------
I am using 3.2.2.ga and it's still not fixed. A simple query like this one is sufficient to break the parser: "select p from Poll p order by p.createDate asc limit ?"
Exception reads:
org.hibernate.HibernateException: ordinal parameter mismatch
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:275)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:97)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
> ParameterParser bug - ordinal parameter mismatch
> -------------------------------------------------
>
> Key: HHH-1423
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1423
> Project: Hibernate3
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.2
> Environment: Windows XP SP2, JDK 1.5.0_06-b05, Spring 1.2.6, antlr-2.7.6rc1
> Reporter: Artur Wronski
> Priority: Critical
> Attachments: HHH1423Test.java, ParameterParser.2.patch, ParameterParser.3.patch, ParameterParser.patch, RecognizerBug.java
>
>
> There is still problem with ParameterParser. The same was in Hibernate 3.1.1
> Runnable TestCase in attachment.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-2541) no-arg function inside "vector expression" not properly replaced with Dialect function mappings
by Steve Ebersole (JIRA)
no-arg function inside "vector expression" not properly replaced with Dialect function mappings
-----------------------------------------------------------------------------------------------
Key: HHH-2541
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2541
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Priority: Minor
For an example of this, see org.hibernate.test.component.basic.ComponentTest#testComponentQueries against a Sybase database.
The issue is the third query in that test: from Employee e where e.person = ('steve', current_timestamp)
The first grammar (hql.g) is currently the one responsible for deciding whether an IDENT node represents a METHOD_CALL. However, it currently does this by seeing if the IDENT is immediately followed by an '('. Here, the current_timestamp method call is not because it is no-arg and so hql.g does not retask the IDENT as a METHOD_CALL. And actually this is correct. The code in hql.g is simply trying to get the common case. And we do not want to blindly look up the IDENT text in the Dialect to see if it matches a mapped function name (because it might also represent a property name, which should take precedence).
The solution is to account for this in the second grammar (hql-sql.g) during recognition of a vector expression. Actually, the correct correct solution is better precedented recognition of atomic expressions...
--
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, 1 month
[Hibernate-JIRA] Commented: (HHH-1039) WrongClassException when scrolling through EntityMode.DOM4J and loading identical objects from different fields
by Jon Seymour (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1039?page=c... ]
Jon Seymour commented on HHH-1039:
----------------------------------
Hi.
I also experienced this issue.
I had a data model that looked like this:
Customer 1 -> n CustomerRole n -> 1 Person
the problem was that on the association between CustomerRole and Person, I named the node rolePerson
whereas on the Person entity itself, I declared the XML node to be person.
Everything worked when I fetched a customer and all objects reachable from the customer.
A problem arose when I declared the associations to be fetch="join" and then did a Criteria-style query on customers which was qualified by person.
This would result in SQL that did joins across the customer, customer role and person entities and would result in the initial person entity being unpacked as a "person" element. Then, when the associations were followed the person would be queried again but this time it would be unpacked as a "rolePerson". This caused a clash that was eventually reported as a WrongClassException.
Per Roland's suggestion, the solution was to given the association that referenced person and the person entity itself the same XML node name (person).
> WrongClassException when scrolling through EntityMode.DOM4J and loading identical objects from different fields
> ---------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1039
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1039
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: Windows XP, JDK 1.4.2_8, Hibernate 3.0.5, Oracle 9.2. Replicated on Windows XP, JDK 1.5.0_2, Hibernate 3.0.5, MySQL
> Reporter: Roland Groen
> Fix For: entity-modes
>
> Attachments: HbmXmlTest.java, Test.hbm.xml
>
>
> When working with XML representations of entities, an unexpected org.hibernate.WrongClassException is thrown when working with identical embedded objects (embed-xml="true") which have different field names.
> org.hibernate.WrongClassException seems to be thrown when:
> 1) Running in EntityMode.DOM4J
> 2) Scrolling through a result set using session.scroll()
> 3) Embedding objects that are:
> a) Referred by least by one of the objects on which the query is selecting primarily (parent object) and,
> b) that field is in FetchMode.JOIN.
> c) Referred by one object which is embedded (embed-xml="true") and uses a different field name to refer to the object than the parent object.
> I would like to apologise for the large test case. The bug is quite hard to reproduce, I tried to minimise the test, but this seems the smallest and most simple case I can find.
> The stack trace is:
> Caused by: org.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: Customer (loaded object was of wrong class)
> at org.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:890)
> at org.hibernate.loader.Loader.getRow(Loader.java:846)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:305)
> at org.hibernate.loader.Loader.loadSingleRow(Loader.java:238)
> at org.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:477)
> at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:106)
> at HbxXmlTest.main(HbxXmlTest.java:90)
> The included files are:
> Test.hbm.xml : the hbm file to create the classes
> HbmXmlTest.java : the the java source to reproduce the issue.
> Greetings,
> Roland.
--
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, 1 month