[Hibernate-JIRA] Created: (HHH-2031) Add functions to Dialect that can disable use of schema and catalog parts -- for HSQLDB support
by Brian Holmes (JIRA)
Add functions to Dialect that can disable use of schema and catalog parts -- for HSQLDB support
-----------------------------------------------------------------------------------------------
Key: HHH-2031
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2031
Project: Hibernate3
Type: Patch
Components: core
Versions: 3.1.3
Environment: This patch is against r9668 of /tags/v313/Hibernate3.
Reporter: Brian Holmes
Attachments: hibernate3-v313-support_schema_catalog_names.patch
HSQLDB does not support the use of three part names, that is Tables with schema and catalog parts.
This patch adds two functions to Dialect: supportsSchemaNames() and supportsCatalogNames(). Table.getQualifiedName() checks these values to decide whether to use or ignore the schema and catalog parts.
By default these are enabled in Dialect. This patch only disables their use in HSQLDialect.
This change is necessary for people who normally use Schema and Catalog names for access their primary database, but also use HSQLDB for Unit Testing. Without it, HSQLDB is unusable for Unit Testing because it fails on use of any catalog or schema names.
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-2448) Generate identical column aliases among cluster
by Loïc LEFEVRE (JIRA)
Generate identical column aliases among cluster
-----------------------------------------------
Key: HHH-2448
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2448
Project: Hibernate3
Type: Improvement
Components: query-sql
Versions: 3.2.2
Environment: Hibernate version: 3.2.2, 2.1.8
Database: Oracle 9.2.0.8
Reporter: Loïc LEFEVRE
Attachments: report_1.txt, report_2.txt
Among our weblogic cluster (12 instances), we can see that a query can have different column aliases.
Although all seems correct, when regarding database reports like StatsPack or Spotlight we can see that because of these different aliases, the reports are wrong. Indeed, a resource consuming query can see its associated report properties (cpu usage, buffer gets, number of executions...) divided by the number of weblogic instances of our cluster (i.e. divided by 12) thus preventing us to pinpoint the queries to look at.
On a 3 instances cluster, we can see this report:
REPORT#1: one statement with a poor number of buffer gets/execution is reported splitted in 3, see the alias generated for column DTO.CREATION_DATE
for example
On a 4 instances cluster, we can see this report:
REPORT#2: one statement responsible of the latch free/cache buffers chains wait events splitted in 4, note the column alias generated fordeffcashcy0_.BEST_EXPECTED_CY
More than confusing the DBAs about the same query with n different "faces", our reports don't show us all the queries to look at: indeed, in our "Top 50 queries", a lot of them are duplicates! Also the memory required in the SGA to store the queries, the execution plan and so on is increased...
Finally, although the column aliases can have up to 30 characters under Oracle, the limit is set to 10, why?
--
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
11 years, 10 months
[Hibernate-JIRA] Created: (HHH-2308) Adjusting the Outer Join Predicate using Criteria Query
by Ben Grant (JIRA)
Adjusting the Outer Join Predicate using Criteria Query
-------------------------------------------------------
Key: HHH-2308
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2308
Project: Hibernate3
Type: New Feature
Components: query-criteria
Versions: 3.2.1
Environment: Linux Using MS SQLServer
Reporter: Ben Grant
I have two tables
Table A
||Col_1||Col_2||
|London| UK |
|Liverpool| UK |
| New York | USA |
Table B
||Col_1||Col_2|| Col_3||
| UK | Europe | 0
| USA | Americas | 1
Using the Criteria class, Restriction Class and FetchMode, Hibernate manages to create a query that looks like this
select distinct top 2000
this_.Col_1 as y0_, TableB3_.Col2 as y1_
from TableA this_
left outer join TableB TableB3_ on this_.Col_2= TableB3_.Col_1
where TableB3_.Col_3=1
When really i need the query to be like this
select distinct top 2000
this_.Col_1 as y0_, TableB3_.Col2 as y1_
from TableA this_
left outer join TableB TableB3_ on this_.Col_2= TableB3_.Col_1 AND TableB3_.Col_3=1
currently their isn't any know way for hibernate to adjust or apply filters within the join clause.
--
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
11 years, 11 months
[Hibernate-JIRA] Created: (HHH-2844) Limit and 'For Update' do not work on Oracle
by Michael Kopp (JIRA)
Limit and 'For Update' do not work on Oracle
--------------------------------------------
Key: HHH-2844
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2844
Project: Hibernate3
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.2
Reporter: Michael Kopp
Limits on oracle lead too:
select * from (select x.y as xy_1 from table x) where rownum <= 5
when doing a for update that leads too
select * from (select x.y as xy_1 from table x) where rownum <= 5 for update of x.y
The problem is that the x.y is invalid and not found within the temporary view and leads to an oracle error.
what would be valid is the name of the view column xy_1, meaning
select * from (select x.y as xy_1 from table x) where rownum <= 5 for update of xy_1
Actually this should be valid in all cases when doing a alias for update lock.
My Solution thus was to override the following in my own Oracle Dialect
public String applyLocksToSql(final String sql, final Map aliasedLockModes, final Map keyColumnNames)
{
final String s = new ForUpdateFragment(this, aliasedLockModes, keyColumnNames)
{
@Override
public ForUpdateFragment addTableAlias(final String alias)
{
// search for alias in sql
final int i = sql.indexOf(alias);
// check if the found string is followed by an ' as ' and thus has a column alias
if (i != -1 && sql.length() > (i + alias.length() + 4) && sql.substring(i + alias.length(), i + alias.length() + 4).equals(
" as "))
{
// use the column alias
return super.addTableAlias(sql.substring(i + alias.length() + 4, sql.indexOf(',',i + alias.length() + 4)));
}
return super.addTableAlias(alias);
}
}.toFragmentString();
return sql + s;
--
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
11 years, 11 months
[Hibernate-JIRA] Created: (HBX-939) Composite IDs and many-to-many relationships
by Markus Kramer (JIRA)
Composite IDs and many-to-many relationships
--------------------------------------------
Key: HBX-939
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-939
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2beta9
Environment: Hibrnate 3.2.1, Postgresql 8.1.8
Reporter: Markus Kramer
Attachments: B.hbm.xml, testdb.sql
The detection of many-to-many relationships doesn't work correctly if the primary key of one of the involved tables consists of more than one field.
An example:
One of two tables (table 'A') of a many-to-many relationship has a primary key consisting of two attributes (id1 and id2).
The generated B.hbm.xml for the table 'B' contains this:
<set name="as" inverse="true" table="a_b">
<key>
<column name="b_id" not-null="true" />
</key>
<many-to-many entity-name="test.A">
<column name="a_id1" not-null="true" />
</many-to-many>
</set>
But there should be another entry for the referenced primary key:
<column name="a_id2" not-null="true" />
The SQL code for the used tables and the complete B.hbm.xml are 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
11 years, 11 months