[Hibernate-JIRA] Created: (ANN-839) Ejb3JoinColumn.linkValueUsingDefaultColumnNaming messes up logical/physical column name
by Marat Radchenko (JIRA)
Ejb3JoinColumn.linkValueUsingDefaultColumnNaming messes up logical/physical column name
---------------------------------------------------------------------------------------
Key: ANN-839
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-839
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.4.0.GA
Reporter: Marat Radchenko
Ejb3JoinColumn.java pretends columnName variable (line 270) is a physical column name (it is proved on line 323).
However.
1. initMappingColumn is called with applyNamingStrategy=false
2. It in turn calls redefineColumnName (still applyNamingStrategy=false).
3. applyNamingStrategy=false -> if statement on line 186 is evaluated to false
4. line 198, original value of columnName is used as _physical_ column name.
So what we get is the same string used as both logical and physical name without any consulting with NamingStrategy. This behavior completely breaks our setup (we want to quote all physical column names).
Proposed solution:
1. Rename columnName to logicalColumnName so assumptions about its usage are more explicit.
2. Call initMappingColumn with applyNamingStrategy=true
--
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
15 years, 7 months
[Hibernate-JIRA] Updated: (HHH-1012) Index not created by SchemaUpdate
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Steve Ebersole updated HHH-1012:
--------------------------------
Issue Type: New Feature (was: Improvement)
> Index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.x, 3.3.x, 3.5
>
> Attachments: Indexes.patch
>
>
> i'm using an hbm.xml as describe below and the 'hibernate.hbm2ddl.auto' is egal to update.
> <class table="featurestat" name=".....">
> <id name="id" type="long" column="idFeatureStat">
> <generator class="increment"/>
> </id>
> <properties name="fsUniqueValue" unique="true">
> ....
> </properties>
> <property name="frequency" .../>
> <property name="idFatherFeature" index="FeatStatDocExtSectFeat" not-null="true" type="long" column="..."/>
> ....
> </class>
> Indexes for pk or unique key are well created, but the index explicity named 'FeatStatDocExtSectFeat' is never created. If i put the property 'hibernate.hbm2ddl.auto' in the cfg.xml as 'create' the index is created. But in my case i have to set my property 'hibernate.hbm2ddl.auto' to update.
--
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
15 years, 7 months
[Hibernate-JIRA] Updated: (HHH-1012) Index not created by SchemaUpdate
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Steve Ebersole updated HHH-1012:
--------------------------------
Assignee: Steve Ebersole
Fix Version/s: 3.5
3.3.x
3.2.x
> Index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate Core
> Issue Type: Improvement
> Components: metamodel
> Affects Versions: 3.2.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.x, 3.3.x, 3.5
>
> Attachments: Indexes.patch
>
>
> i'm using an hbm.xml as describe below and the 'hibernate.hbm2ddl.auto' is egal to update.
> <class table="featurestat" name=".....">
> <id name="id" type="long" column="idFeatureStat">
> <generator class="increment"/>
> </id>
> <properties name="fsUniqueValue" unique="true">
> ....
> </properties>
> <property name="frequency" .../>
> <property name="idFatherFeature" index="FeatStatDocExtSectFeat" not-null="true" type="long" column="..."/>
> ....
> </class>
> Indexes for pk or unique key are well created, but the index explicity named 'FeatStatDocExtSectFeat' is never created. If i put the property 'hibernate.hbm2ddl.auto' in the cfg.xml as 'create' the index is created. But in my case i have to set my property 'hibernate.hbm2ddl.auto' to update.
--
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
15 years, 7 months
[Hibernate-JIRA] Updated: (HHH-1930) QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930?page=c... ]
Steve Ebersole updated HHH-1930:
--------------------------------
Priority: Minor (was: Major)
Assignee: Steve Ebersole
Fix Version/s: 3.5
3.3.x
3.2.x
> QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1930
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3
> Reporter: Manfred Geiler
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.x, 3.3.x, 3.5
>
> Attachments: HibernateTestCase.zip, hqlsqlwalker.diff
>
>
> In Version 3.1.2 the following "EventManager" HQL query worked fine:
> select p from Person p join p.emailAddresses as email with email = 'xyz'
> and produced an SQL query like this:
> select person0_.PERSON_ID as PERSON1_2_, person0_.age as age2_, person0_.firstname as firstname2_, person0_.lastname as lastname2_
> from PERSON person0_
> inner join PERSON_EMAIL_ADDR emailaddre1_
> on person0_.PERSON_ID=emailaddre1_.PERSON_ID and (emailaddre1_.EMAIL_ADDR='xyz')
> From Version 3.1.3 on this HQL throws the following QuerySyntaxException:
> "with-clause expressions did not reference from-clause element to which the with-clause was associated"
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HHH-3532) schema update task should look for foreign key signature
by Dan Allen (JIRA)
schema update task should look for foreign key signature
--------------------------------------------------------
Key: HHH-3532
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3532
Project: Hibernate Core
Issue Type: Improvement
Components: metamodel
Affects Versions: 3.3.1
Reporter: Dan Allen
Priority: Minor
When the schema update task runs, it attempts to locate a foreign key in the database that matches the name provided in the Hibernate mapping information for that particular association. (The name of the foreign key is specified either in the foreign-key attribute in a mapping file or the @ForeignKey annotation). That much works fine. It's when a foreign key name is not provided, common in the case when standard JPA mappings are used, that problems arise.
When a foreign key name is not provided, Hibernate generates a key name as follows:
"FK" + hash code of referenced entity name + hash codes of columns
The chances of an existing foreign key in the database using this generated name is slim to none (every DBA has their own conventions that they follow). Thus, as soon as the scheme update task hits a database under these conditions, duplicate foreign key definitions appear all over the place.
If a foreign key name is not provided in the mapping, Hibernate should be looking instead to see if the signature of the foreign key matches that which is required to fulfill the mapping. In fact, I would even argue that the name is irrelevant and should only be used when actually *creating* the foreign key.
Here is the existing logic in the generateSchemaUpdateScript in Configuration:
ForeignKey fk = (ForeignKey) subIter.next();
boolean create = tableInfo == null || tableInfo.getForeignKeyMetadata( fk.getName() ) == null;
It should be like this instead:
ForeignKey fk = (ForeignKey) subIter.next();
boolean create = tableInfo == null || tableInfo.getForeignKeyMetadata( fk ) == null;
getForeignKeyMetadata should retrieve based on the fk signature rather than the fk name.
--
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
15 years, 7 months
[Hibernate-JIRA] Updated: (HHH-1930) QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
by Oleg Golberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930?page=c... ]
Oleg Golberg updated HHH-1930:
------------------------------
Attachment: hqlsqlwalker.diff
Sorry, here is the correct patch. Please ignore my previous attachment.
> QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1930
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3
> Reporter: Manfred Geiler
> Attachments: HibernateTestCase.zip, hqlsqlwalker.diff, hqlwalker.diff
>
>
> In Version 3.1.2 the following "EventManager" HQL query worked fine:
> select p from Person p join p.emailAddresses as email with email = 'xyz'
> and produced an SQL query like this:
> select person0_.PERSON_ID as PERSON1_2_, person0_.age as age2_, person0_.firstname as firstname2_, person0_.lastname as lastname2_
> from PERSON person0_
> inner join PERSON_EMAIL_ADDR emailaddre1_
> on person0_.PERSON_ID=emailaddre1_.PERSON_ID and (emailaddre1_.EMAIL_ADDR='xyz')
> From Version 3.1.3 on this HQL throws the following QuerySyntaxException:
> "with-clause expressions did not reference from-clause element to which the with-clause was associated"
--
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
15 years, 7 months