[Hibernate-JIRA] Updated: (HB-534) Table schema use in DatabaseMetadata
by Anonymous (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-534?page=all ]
updated HB-534:
----------------
Attachment: patch1.2.txt
> Table schema use in DatabaseMetadata
> ------------------------------------
>
> Key: HB-534
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-534
> Project: Hibernate2
> Type: Bug
> Components: core
> Versions: 2.1 beta 4
> Environment: Hibernate 2.1 beta 4, Oracle 8i
> Reporter: Adrien
> Attachments: DatabaseMetadata.java, HB-534_patch.txt, TableMetadata.java, patch.txt, patch1.1.txt, patch1.2.txt, schemavalidation.zip
>
>
> When using SchemaUpdate, the DatabaseMetaData.getTableMetadata() looks for a table with the correct table name in any database schema and it take the first one it found. This behavior is uncorrect if I have a table existing in different schemas.
> The correct behavior would be to first look in the schema with the login name and after in any schema.
> user1.article
> user2.article
> I connected whith user2, DatabaseMetaData should first look for user2.article, then if not found to %.article.
> Adrien
--
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
19 years, 3 months
[Hibernate-JIRA] Created: (HHH-2136) HQL generates wrong sql statements
by Gulshanrai BABAJEE (JIRA)
HQL generates wrong sql statements
----------------------------------
Key: HHH-2136
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2136
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.1.3, 3.2.0.cr5
Environment: Hibernate version 3.1.3
postgresql version 8.1.4
Reporter: Gulshanrai BABAJEE
Priority: Critical
Hi,
I have created an HQL statement as shown below. It is working very fine:
QUERY 1 (working):
SELECT new Map (ea.entry.reference AS reference, ea.entry.amount AS amount, ea.entry.date AS date,
ea.account.absoluteBalance AS balance, ea.account.contract.referenceSaga1 AS refSaga1,
ea.account.contract.reference AS refSaga2, ea.account.contract.subscriber.personalDetail.firstName AS firstName,
ea.account.contract.subscriber.personalDetail.lastName AS lastName) FROM EntryAccountH ea
Then I modified the above hql statement by adding 2 more fields (paymentMethod & contractStatus) in my select as shown below:
QUERY 2 (not working):
SELECT new Map (ea.entry.reference AS reference, ea.entry.amount AS amount, ea.entry.date AS date,
ea.account.absoluteBalance AS balance, ea.account.contract.referenceSaga1 AS refSaga1,
ea.account.contract.reference AS refSaga2, ea.account.contract.subscriber.personalDetail.firstName AS firstName,
ea.account.contract.subscriber.personalDetail.lastName AS lastName,
ea.account.contract.payer.paymentMethod AS paymentMethod, ea.account.contract.status AS contractStatus)
FROM EntryAccountH ea
The generated sql statement by hiberante (after cleaning) is as follows:
QUERY 3 (not working):
select e.reference, e.amount, e.date, a.absolute_balance, c.reference_saga1, c.reference, p.first_name, p.last_name,
py.payment_method_id, c.status_id
from entry_account ea, entry e, account a, contract c, subscriber s, personal_detail p,
payer py inner join payment_method pm on py.payment_method_id=pm.id
inner join contract_status cs on c.status_id=cs.id
where c.payer_id=py.id and s.personal_detail_id=p.id and c.subscriber_id=s.id and a.contract_id=c.id
and ea.account_id=a.id and ea.entry_id=e.id
When I run query 2 & 3 I got the following error:
ERROR: invalid reference to FROM-clause entry for table "c"
HINT: There is an entry for table "c", but it cannot be referenced from this part of the query.
After looking at query 3 carefully, I found that it is because the table 'contract' in the 'from' statement is misplaced. In fact the query should be like this:
QUERY 4 (working):
select e.reference, e.amount, e.date, a.absolute_balance, c.reference_saga1, c.reference, p.first_name, p.last_name,
py.payment_method_id, c.status_id
from entry_account ea, entry e, account a, subscriber s, personal_detail p,
payer py inner join payment_method pm on py.payment_method_id=pm.id
contract c inner join contract_status cs on c.status_id=cs.id
where c.payer_id=py.id and s.personal_detail_id=p.id and c.subscriber_id=s.id and a.contract_id=c.id
and ea.account_id=a.id and ea.entry_id=e.id
I think that hibernate is wrongly generating the sql statement.
I've done another test also. I've placed the field contractStatus of my select statement at the first position as shown below :
QUERY 5 (working):
SELECT new Map (ea.account.contract.status AS contractStatus, ea.entry.reference AS reference, ea.entry.amount AS amount, ea.entry.date AS date,
ea.account.absoluteBalance AS balance, ea.account.contract.referenceSaga1 AS refSaga1,
ea.account.contract.reference AS refSaga2, ea.account.contract.subscriber.personalDetail.firstName AS firstName,
ea.account.contract.subscriber.personalDetail.lastName AS lastName, ea.account.contract.payer.paymentMethod AS paymentMethod)
FROM EntryAccountH ea
The generated sql statement by hiberante (after cleaning) is as follows:
QUERY 6 (working):
select e.reference, e.amount, e.date, a.absolute_balance, c.reference_saga1, c.reference, p.first_name, p.last_name,
py.payment_method_id, c.status_id
from entry_account ea, entry e, account a, subscriber s, personal_detail p,
contract c inner join contract_status cs on c.status_id=cs.id
payer py inner join payment_method pm on py.payment_method_id=pm.id
where c.payer_id=py.id and s.personal_detail_id=p.id and c.subscriber_id=s.id and a.contract_id=c.id
and ea.account_id=a.id and ea.entry_id=e.id
Conclusion: query 5 and 6 run correctly.
Hope you've understood what's the problem and that it can be corrected as soon as possible
Thanks in advance
gulshan
--
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
19 years, 3 months
[Hibernate-JIRA] Updated: (HB-534) Table schema use in DatabaseMetadata
by Anthony Patricio (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-534?page=all ]
Anthony Patricio updated HB-534:
--------------------------------
Attachment: patch1.1.txt
> Table schema use in DatabaseMetadata
> ------------------------------------
>
> Key: HB-534
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-534
> Project: Hibernate2
> Type: Bug
> Components: core
> Versions: 2.1 beta 4
> Environment: Hibernate 2.1 beta 4, Oracle 8i
> Reporter: Adrien
> Attachments: DatabaseMetadata.java, HB-534_patch.txt, TableMetadata.java, patch.txt, patch1.1.txt, schemavalidation.zip
>
>
> When using SchemaUpdate, the DatabaseMetaData.getTableMetadata() looks for a table with the correct table name in any database schema and it take the first one it found. This behavior is uncorrect if I have a table existing in different schemas.
> The correct behavior would be to first look in the schema with the login name and after in any schema.
> user1.article
> user2.article
> I connected whith user2, DatabaseMetaData should first look for user2.article, then if not found to %.article.
> Adrien
--
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
19 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1916) param values in generator element should be trimmed during HbmBinding
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1916?page=c... ]
Max Rydahl Andersen commented on HHH-1916:
------------------------------------------
I just commented on the 3.1.4 release planned question and the wrong assumption about 3.2 and annotations. Not about the quality of the fix.
> param values in generator element should be trimmed during HbmBinding
> ---------------------------------------------------------------------
>
> Key: HHH-1916
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1916
> Project: Hibernate3
> Type: Bug
> Components: metamodel
> Versions: 3.1.3, 3.2.0.cr3
> Environment: Oracle 10g, JDK 1.5.0_06, linux, hibernate 3.1.3
> Reporter: Renaud Bruyeron
> Attachments: patch-Branch_3_1.txt, patch-Branch_3_2.txt
>
>
> When using IDEs or tools like xdoclet to generate HBM files, it is easy to get XML like this:
> <generator class="sequence">
> <param
> name="sequence"
> >
> SEQ_SOME_SEQUENCE
> </param>
> </generator>
> However the SchemaValidator barfs on this because the HbmBinder does not trim the sequence name.
> The fix is similar to the fix for HBX-423 I believe, i.e. in HbmBinder.java in method makeIdentifier(...), use getTextTrim() instead of getText().
> In 3.1 branch, this is at line 1902. On trunk this is line 1990.
--
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
19 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1916) param values in generator element should be trimmed during HbmBinding
by Renaud Bruyeron (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1916?page=c... ]
Renaud Bruyeron commented on HHH-1916:
--------------------------------------
indeed, 3.2 does not require annotations, but then this bug makes it unnecessary difficult to use hbm-generators such as xdoclet or some IDEs.
Is there something wrong with the proposed fix?
> param values in generator element should be trimmed during HbmBinding
> ---------------------------------------------------------------------
>
> Key: HHH-1916
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1916
> Project: Hibernate3
> Type: Bug
> Components: metamodel
> Versions: 3.1.3, 3.2.0.cr3
> Environment: Oracle 10g, JDK 1.5.0_06, linux, hibernate 3.1.3
> Reporter: Renaud Bruyeron
> Attachments: patch-Branch_3_1.txt, patch-Branch_3_2.txt
>
>
> When using IDEs or tools like xdoclet to generate HBM files, it is easy to get XML like this:
> <generator class="sequence">
> <param
> name="sequence"
> >
> SEQ_SOME_SEQUENCE
> </param>
> </generator>
> However the SchemaValidator barfs on this because the HbmBinder does not trim the sequence name.
> The fix is similar to the fix for HBX-423 I believe, i.e. in HbmBinder.java in method makeIdentifier(...), use getTextTrim() instead of getText().
> In 3.1 branch, this is at line 1902. On trunk this is line 1990.
--
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
19 years, 3 months
[Hibernate-JIRA] Created: (HB-1569) newSession.get(obj.getClass(),obj.getObjectID()) works well using HibernateTransactionManager, but fails when using JTATransactionManager.
by Priti Parkar (JIRA)
newSession.get(obj.getClass(),obj.getObjectID()) works well using HibernateTransactionManager, but fails when using JTATransactionManager.
------------------------------------------------------------------------------------------------------------------------------------------
Key: HB-1569
URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1569
Project: Hibernate2
Type: Task
Environment: Hibernate-2, Oracle db using JDBC connection.
Reporter: Priti Parkar
Attachments: SystemOut.log
I am making a following call in HibernateTransactionMAnager environement,
Session newSession = lSessionFactory.openSession();
PersistentObject persobj = (PersistentObject) newSession.get(obj.getClass(),obj.getObjectID());
This call fetches me the not-refreshed data in local Hibernate transactions, but while using JTA transaction manager, it fetches me the refreshed data. I want the above call to fetch me the data which has not yet been updated during the transaction. How do I fetched the original data(not yet flushed in the database) in JTA environment?
--
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
19 years, 3 months