[Hibernate-JIRA] Created: (ANN-429) Exporters : Clarify template context and classes responsabilities
by Michelle Baert (JIRA)
Exporters : Clarify template context and classes responsabilities
-----------------------------------------------------------------
Key: ANN-429
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-429
Project: Hibernate Annotations
Type: Task
Components: documentation
Versions: 3.2.0.cr1
Reporter: Michelle Baert
As you said in HBX-745, there's an importContext problem again when trying to use the query parameter types
from templates.
I built another exporter with an ImportContext field added, and automatic destination package detection, and tried to see if it couldn't be done directly in Generic Exporter.
It arises that through the exportClasses() method, the destination package may change from one mapped class to another.
But difficulties come when confusion is made between referred mapped class and newly generated referring class.
The freemarker datamodel is filled with tons of properties, objects and methods for which it is very difficult to find out which deals with what.
My (sub)project of building new templates leads to reverse engineer alone too much of the *uncommented* code of the actual release.
Maybe defining classes responsabilities could lead to some changes in project architecture, and allow to clean-up many work-arounds, but, ;) , this is not *my* role .
But it should worth it :)
Best regards,
Michelle Baert
--
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, 8 months
[Hibernate-JIRA] Commented: (HB-1458) SchemaUpdate does not create column indexes (MySql)
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-1458?page=co... ]
Max Rydahl Andersen commented on HB-1458:
-----------------------------------------
one of the reasons we dont do so much fixing in schemaupdate is because there doesnt exist proper testsuite....so you have all the liberty you want in creating a test suite for it ,)
> SchemaUpdate does not create column indexes (MySql)
> ---------------------------------------------------
>
> Key: HB-1458
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1458
> Project: Hibernate2
> Type: Improvement
> Components: toolset
> Versions: 2.1.8
> Environment: Hibernate version: 2.1.8, MySQL version: 4.0.20, MySQL driver: mysql-connector-java-3.0.10-stable (also verified with 3.0.16 and 3.1.7)
> Reporter: Keith Wall
> Priority: Minor
> Attachments: CSDiff.txt
>
>
> From forum thread: http://forum.hibernate.org/viewtopic.php?t=939655
> SchemaUpdate is failing to create indices specified using the <column> element in the mapping file. There is no error message generated. If I repeat the same test with the SchemaExport utility, the indices are created successfully.
> I include:
> 1) A mapping file that demonstrates the problem. This is a modified version of Simple.hbm.xml included in the Hibernate 2.1.8 distribution.
> 2) SQL sent to the server by SchemaUpdate (starting with a clean DB).
> 3) For comparison, the SQL sent to the server by SchemaExport (starting with a clean DB).
> Mapping file:
> <hibernate-mapping>
> <class name="org.hibernate.test.Simple">
> <id type="long" column="id_">
> <generator class="assigned"/>
> </id>
> <!-- BEGIN MODIFICATION -->
> <property name="name">
> <column name="name"
> index="test_idx" />
> </property>
> <!-- END MODIFICATION -->
> <property name="address"/>
> <property name="count" column="count_" not-null="true" unique="true"/>
> <property name="date" column="date_"/>
> <property name="pay"/>
> <many-to-one name="other" access="field"/>
> </class>
> </hibernate-mapping>
> Result:
> The table is created successfully, the primary key is created successfully, but no index on the column 'name' is created.
> SQL sent to server by SchemaUpdate:
> 050309 15:42:57 69 Init DB test
> 69 Query select round('inf'), round('-inf'), round('nan')
> 69 Query SHOW VARIABLES
> 69 Query SET autocommit=1
> 69 Query SET autocommit=0
> 69 Query commit
> 69 Query SET autocommit=1
> 69 Query SHOW TABLES FROM `test` LIKE 'Simple'
> 69 Query SHOW TABLES FROM `test` LIKE 'Simple'
> 69 Query create table Simple (id_ bigint not null, name varchar(255), address varchar(255), count_ integer not null unique, date_ datetime, pay float, other bigint, primary key (id_))
> 69 Query alter table Simple add index FK939D1DD26527F10 (other), add constraint FK939D1DD26527F10 foreign key (other) references Simple (id_)
> 69 Query SET autocommit=0
> 69 Query rollback
> 69 Quit
> SQL sent to server by SchemaExport:
> 050309 15:48:22 70 Connect root@localhost on test
> 70 Init DB test
> 70 Query select round('inf'), round('-inf'), round('nan')
> 70 Query SHOW VARIABLES
> 70 Query SET autocommit=1
> 70 Query SET autocommit=0
> 70 Query commit
> 70 Query SET autocommit=1
> 70 Query alter table Simple drop foreign key FK939D1DD26527F10
> 70 Query drop table if exists Simple
> 70 Query create table Simple (id_ bigint not null, name varchar(255), address varchar(255), count_ integer not null unique, date_ datetime, pay float, other bigint, primary key (id_))
> 70 Query create index test_idx on Simple (name)
> 70 Query alter table Simple add index FK939D1DD26527F10 (other), add constraint FK939D1DD26527F10 foreign key (other) references Simple (id_)
> 70 Quit
--
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, 8 months
[Hibernate-JIRA] Commented: (HHH-1012) index not created by SchemaUpdate
by Erik G (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Erik G commented on HHH-1012:
-----------------------------
Christian, thanks for the pointer. I would like to get SchemaUpdate to generate the indexes the same way SchemaExport does. Seems like the patch on this issue would work but needs to have an accompanying unit test to make sure nothing gets broken. I'm happy to create the testcase if one ws never built, I just need a pointer to what test cases already exist for modifcations to SchemaUpdate.
> index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate3
> Type: Bug
> Versions: 3.1 beta 1, 3.1 beta 2, 3.0.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Priority: Minor
> 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
17 years, 8 months
[Hibernate-JIRA] Commented: (HB-1458) SchemaUpdate does not create column indexes (MySql)
by Erik G (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HB-1458?page=co... ]
Erik G commented on HB-1458:
----------------------------
Max,
I'll take a stab at writing a test case for the patch submitted under HHH-1012 - what would be a good test case for prior SchemaUpdate/Export patches for me to emulate?
thx, Erik
> SchemaUpdate does not create column indexes (MySql)
> ---------------------------------------------------
>
> Key: HB-1458
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1458
> Project: Hibernate2
> Type: Improvement
> Components: toolset
> Versions: 2.1.8
> Environment: Hibernate version: 2.1.8, MySQL version: 4.0.20, MySQL driver: mysql-connector-java-3.0.10-stable (also verified with 3.0.16 and 3.1.7)
> Reporter: Keith Wall
> Priority: Minor
> Attachments: CSDiff.txt
>
>
> From forum thread: http://forum.hibernate.org/viewtopic.php?t=939655
> SchemaUpdate is failing to create indices specified using the <column> element in the mapping file. There is no error message generated. If I repeat the same test with the SchemaExport utility, the indices are created successfully.
> I include:
> 1) A mapping file that demonstrates the problem. This is a modified version of Simple.hbm.xml included in the Hibernate 2.1.8 distribution.
> 2) SQL sent to the server by SchemaUpdate (starting with a clean DB).
> 3) For comparison, the SQL sent to the server by SchemaExport (starting with a clean DB).
> Mapping file:
> <hibernate-mapping>
> <class name="org.hibernate.test.Simple">
> <id type="long" column="id_">
> <generator class="assigned"/>
> </id>
> <!-- BEGIN MODIFICATION -->
> <property name="name">
> <column name="name"
> index="test_idx" />
> </property>
> <!-- END MODIFICATION -->
> <property name="address"/>
> <property name="count" column="count_" not-null="true" unique="true"/>
> <property name="date" column="date_"/>
> <property name="pay"/>
> <many-to-one name="other" access="field"/>
> </class>
> </hibernate-mapping>
> Result:
> The table is created successfully, the primary key is created successfully, but no index on the column 'name' is created.
> SQL sent to server by SchemaUpdate:
> 050309 15:42:57 69 Init DB test
> 69 Query select round('inf'), round('-inf'), round('nan')
> 69 Query SHOW VARIABLES
> 69 Query SET autocommit=1
> 69 Query SET autocommit=0
> 69 Query commit
> 69 Query SET autocommit=1
> 69 Query SHOW TABLES FROM `test` LIKE 'Simple'
> 69 Query SHOW TABLES FROM `test` LIKE 'Simple'
> 69 Query create table Simple (id_ bigint not null, name varchar(255), address varchar(255), count_ integer not null unique, date_ datetime, pay float, other bigint, primary key (id_))
> 69 Query alter table Simple add index FK939D1DD26527F10 (other), add constraint FK939D1DD26527F10 foreign key (other) references Simple (id_)
> 69 Query SET autocommit=0
> 69 Query rollback
> 69 Quit
> SQL sent to server by SchemaExport:
> 050309 15:48:22 70 Connect root@localhost on test
> 70 Init DB test
> 70 Query select round('inf'), round('-inf'), round('nan')
> 70 Query SHOW VARIABLES
> 70 Query SET autocommit=1
> 70 Query SET autocommit=0
> 70 Query commit
> 70 Query SET autocommit=1
> 70 Query alter table Simple drop foreign key FK939D1DD26527F10
> 70 Query drop table if exists Simple
> 70 Query create table Simple (id_ bigint not null, name varchar(255), address varchar(255), count_ integer not null unique, date_ datetime, pay float, other bigint, primary key (id_))
> 70 Query create index test_idx on Simple (name)
> 70 Query alter table Simple add index FK939D1DD26527F10 (other), add constraint FK939D1DD26527F10 foreign key (other) references Simple (id_)
> 70 Quit
--
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, 8 months
[Hibernate-JIRA] Commented: (HHH-1012) index not created by SchemaUpdate
by Erik G (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Erik G commented on HHH-1012:
-----------------------------
has anyone actually built a test case for this yet so it can be accepted as a patch?
> index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate3
> Type: Bug
> Versions: 3.1 beta 1, 3.1 beta 2, 3.0.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Priority: Minor
> 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
17 years, 8 months
[Hibernate-JIRA] Created: (HHH-2046) ability to use dialect-registered functions in formula mappings
by Steve Ebersole (JIRA)
ability to use dialect-registered functions in formula mappings
---------------------------------------------------------------
Key: HHH-2046
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2046
Project: Hibernate3
Type: Improvement
Components: core
Reporter: Steve Ebersole
Assigned to: Steve Ebersole
Consider org.hibernate.test.compositeelement.CompositeElementTest. Currently, those tests fail on Sybase/SQLServer because neither of those databases support a length function and the mappings map a property formula using the length function.
Both dialects do however, map the length() to len() which is valid on both.
Perhaps a syntax like:
<property name="bioLength" formula="fn:length(bio)"/> or <property name="bioLength" formula="fn:{length(bio)}"/>
Eventually maybe even:
<property name="bioLength" formula="{length(bio)}"/>
where anything inside the {} would be treated as HQL fragment. That, of course, relies on the redesign of the translator (if it is even doable then).
--
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, 8 months
[Hibernate-JIRA] Deleted: (HBX-746) Exporters : Clarify template context and classes responsabilities
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-746?page=all ]
Max Rydahl Andersen deleted HBX-746:
------------------------------------
> Exporters : Clarify template context and classes responsabilities
> -----------------------------------------------------------------
>
> Key: HBX-746
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-746
> Project: Hibernate Tools
> Type: Task
> Reporter: Michelle Baert
>
>
> As you said in HBX-745, there's an importContext problem again when trying to use the query parameter types
> from templates.
> I built another exporter with an ImportContext field added, and automatic destination package detection, and tried to see if it couldn't be done directly in Generic Exporter.
> It arises that through the exportClasses() method, the destination package may change from one mapped class to another.
> But difficulties come when confusion is made between referred mapped class and newly generated referring class.
> The freemarker datamodel is filled with tons of properties, objects and methods for which it is very difficult to find out which deals with what.
> My (sub)project of building new templates leads to reverse engineer alone too much of the *uncommented* code of the actual release.
> Maybe defining classes responsabilities could lead to some changes in project architecture, and allow to clean-up many work-arounds, but, ;) , this is not *my* role .
> But it should worth it :)
> Best regards,
> Michelle Baert
--
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, 8 months