[Hibernate-JIRA] Created: (HHH-3004) The comment syntax /* */ fails on DB2 for z/OS
by Steen Klingenberg (JIRA)
The comment syntax /* */ fails on DB2 for z/OS
-----------------------------------------------
Key: HHH-3004
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3004
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.5
Environment: Hibernate version 3.2.5
DB2 for z/OS version 8.2
Reporter: Steen Klingenberg
Priority: Minor
if the property use_sql_comments is set to true comments with the syntax /* */ issued in Hibernate SQL statements causes DB2 to fail because the syntax is NOT supported when connecting from a Java application...
>From the DB2 manual - source: DB2 SQL Reference v8 zOS
Comments in SQL statements: SQL statements can include host language comments or SQL comments. Either type of comment can be specified wherever a space is valid, except within a delimiter token or between the keywords EXEC and SQL. The following rules apply to SQL comments:
- The two hyphens must be on the same line, not separated by a space.
- Comments cannot be continued on the next line.
- Within a statement embedded in a COBOL program, the two hyphens must be preceded by a blank unless they begin a line.
- In Java, SQL comments are not allowed within embedded Java expressions.
For "host languages", however, comments following the syntax /* */ are allowed! Host languages include COBOL, C, Rexx... but not Java!
Would it perhaps be possible to externalize the Java statements creating the comment String into the Dialect class hierarchy ?
e.g. modifying (in InsertSelect):
buf.append( "/* " ).append( comment ).append( " */ " );
It requires the comments to be single-lined though - at least for DB2. Otherwise it doesn't follow above rules!
Having only experience from the combination Hibernate and DB2 for z/OS and no SQL embedded comments I cannot tell the benefit potential.
--
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
18 years, 4 months
[Hibernate-JIRA] Commented: (HHH-1476) Table.qualify does not handle dialect diferences
by Consuelo Franky (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1476?page=c... ]
Consuelo Franky commented on HHH-1476:
---------------------------------------
Please: would you explain how to apply the patch proposed by Mike A. Meyer in order to use sucessfully hibernate on an Informix database ?
We are developing a project in Java EE 5 using JBoss 4.2.1+ and an Informix database and we have problems with the JPQL queries because hibernate transform in SQL queries with '.' as catalog separator instead of ':'
With your patch: must we generate another version of the hibernate library (.jar) ?
Thanks in advance
Maria Consuelo Franky
consuelofranky(a)gmail.com
> Table.qualify does not handle dialect diferences
> ------------------------------------------------
>
> Key: HHH-1476
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1476
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Environment: Hibernate 3.1.2
> SQL Server 2000
> Reporter: Justin Kolb
> Attachments: informix-table-qname-patch-NPAC-vs-v324sp1.diff, informix-table-qname-patch-NPAC.diff, informix-table-qname-patch.diff
>
>
> The fix for HHH-699 caused me to discover that Hibernate isn't handling qualifying table names properly. It can be inferred from HHH-699 that not all databases are similar in this respect so I think this should be added to the dialect handling. From my short research I have the following 3 cases:
> SQL Server: database.owner.table
> MySQL: database.table (no schemas it seems)
> Most others: catalog.schema.table
> SQL Server also allows for "database..table" since it does not have schemas but does allow you to write queries that cross databases similar to how you can cross schemas in other database servers.
> Testing on Postgres though I determined that it does not allow "catalog..table" and will only accept "catalog.schema.table", so it dos not match up with SQL Server in this respect. If you write "catalog.table" it thinks you are trying to use a schema so it does not match up with MySQL in this respect.
> So right now only MySQL and SQL Server are the non standard compliant databases. Before 3.1 beta 1, SQL Server was handled correctly; then after that only MySQL was handled correctly.
> I'm not sure how much work it would take to make this change.
--
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
18 years, 4 months
[Hibernate-JIRA] Created: (HHH-2048) Incomplete MappingException at org.hibernate.mapping.SimpleValue
by Diego Pires Plentz (JIRA)
Incomplete MappingException at org.hibernate.mapping.SimpleValue
----------------------------------------------------------------
Key: HHH-2048
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2048
Project: Hibernate3
Type: Improvement
Versions: 3.2.0.cr4
Reporter: Diego Pires Plentz
When a mapped class has a wrong type, an exception is throwed, but it doesnt say nothing about what class/table is mapped wrongly.
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
Can become something like this...
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(table != null){
msg += ", at table: " + table.getName();
}
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
--
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
18 years, 4 months
[Hibernate-JIRA] Created: (HHH-2739) 'illegal attempt to dereference collection' when referencing a single-valued association in an implicit join
by Martin Kouba (JIRA)
'illegal attempt to dereference collection' when referencing a single-valued association in an implicit join
------------------------------------------------------------------------------------------------------------
Key: HHH-2739
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2739
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4.sp1, 3.2.4, 3.2.3
Environment: I have found that behaviour in version 3.2.4.sp1 and 3.2.3 (I didn't test 3.2.4 pre sp1)
Database: ORACLE 10g
Reporter: Martin Kouba
After upgrading to the latest Hibernate version I got this error.
I try to use a statement like this
from cat c where c.mate.id = 13
the expected resulting SQL should be something like
SELECT * FROM CAT C WHERE C.MATE_ID = 13
which is much more performant than making a join
from cat c join c.mate m where m.id = 13
which would result in something like that
SELECT * FROM CAT C INNER JOIN MATE M ON C.MATE_ID = M.ID WHERE M.ID = 13
This works as expected in 3.1.3, 3.2.0 and 3.2.2
It doesn't work with version 3.2.3 and with 3.2.4.sp1.
As test case you can take the example from the documentation chapter 5.1.16
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="eg">
<class name="Cat" table="CATS">
<id name="id" column="uid" type="long">
<generator class="hilo"/>
</id>
<property name="birthdate" type="date"/>
<property name="color" not-null="true"/>
<property name="sex" not-null="true"/>
<property name="weight"/>
<many-to-one name="mate"/>
<set name="kittens">
<key column="MOTHER"/>
<one-to-many class="Cat"/>
</set>
<joined-subclass name="DomesticCat" table="DOMESTIC_CATS">
<key column="CAT"/>
<property name="name" type="string"/>
</joined-subclass>
</class>
<class name="eg.Dog">
<!-- mapping for Dog could go here -->
</class>
</hibernate-mapping>
c = new Cat();
c.setMate(new Cat());
c.persist();
int id = c.getId();
List results = session.createQuery("from Cat as c where c.mate.id = 16).list();
according to manual section 14.5 this should work
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#queryhql-i...
Ok, I hope this is clear enough and the test case is clear enough as well.
This is a major stopper for an upgrade. I have reported that on June 11th
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2667
But it seems that others used the same case to report a similar issue regarding automatic joins.
According to Christian Bauer automatic joins are no longer supported, closed the case and told me to reopen it again.
So to all others please do not add comments to this case if it is not about it. And to the Hibernate developers: Greate work you are doing but please I think the issue was clear when I reported it the first time. It is quite easy to reproduce and occurs quite often in a medium size project.
Gratitude
Martin
--
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
18 years, 4 months