[Hibernate-JIRA] Closed: (HHH-884) SchemaExport does not propagate parent indexes to <union-subclass> tables
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-884?page=co... ]
Steve Ebersole closed HHH-884.
------------------------------
Closing stale resolved issues
> SchemaExport does not propagate parent indexes to <union-subclass> tables
> -------------------------------------------------------------------------
>
> Key: HHH-884
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-884
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.3
> Reporter: Keith D Gregory
> Assignee: Gavin King
> Fix For: 3.1 rc 1
>
> Attachments: Cat.hbm.xml, Cat.java, PolydactylCat.hbm.xml, PolydactylCat.java, propagateConstraints.diff, propagateIndexesToUnionSubclasses.diff, Test.java
>
>
> When using <union-subclass>, you want to propagate parent table indexes to child tables to improve query speeds. For example, this HBM (a cut-n-paste of the separate files I'm attaching, so may have errors) should index cats by name in both the CAT and POLYDACTYL_CAT tables.
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping>
> <class name="example.Cat" table="CAT">
> <id name="id" type="string" unsaved-value="null" >
> <column name="CAT_ID" sql-type="char(32)" not-null="true"/>
> <generator class="uuid.hex"/>
> </id>
> <!-- index this so we can look for cats by name -->
> <property name="name">
> <column name="NAME" length="16" not-null="true" index="IDX_NAME"/>
> </property>
> <union-subclass name="example.PolydactylCat" table="POLYDACTYL_CAT">
> <property name="leftFront"/>
> <property name="rightFront"/>
> <property name="leftRear"/>
> <property name="rightRear"/>
> </union-subclass>
> </class>
> </hibernate-mapping>
> However, with versions up to 3.0.3, this only creates the index on the CAT table.
--
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
[Hibernate-JIRA] Closed: (HHH-1154) Startup times are a significant issue
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1154?page=c... ]
Steve Ebersole closed HHH-1154.
-------------------------------
Closing stale resolved issues
> Startup times are a significant issue
> -------------------------------------
>
> Key: HHH-1154
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1154
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: Hibernate 3.0.5, Running in Spring 1.2.5, Oracle 9i database
> Reporter: Tyler Van Gorder
> Attachments: callTreeView.zip
>
> Original Estimate: 224h
> Remaining Estimate: 224h
>
> We are currently evaluating Hibernate as our persistence layer for our next big project. This project will be built on a pre-existing enterprise database that has 600+ tables.
> As part of the evaulation process we have generated mapping files for about 300+ of those tables.
> This is where we run into a potential show-stopper for us:
> The startup of the application is taking 40+ seconds. Most of this time is being spent building the session factory, as it appears that the factory is loading and validating all 300+ mapping files. I will have a very difficult time introducing hibernate into our environment (especially in development) when starting the application takes this long. The code/run/debug cycle will simply be unacceptable.
> I have switched the mappings to use the addCacheableFile and this has not really improved the performance that much. Again, it appears that most of the time is being spent in the creating of the factory.
> Can we cut down on the amount of validation the session factory build is performing on the mappings?
> Is there a way to have the factory load the mappings on demand? And if this functionality does not currently exist, how hard would it be to implement this feature in the factory implementation?
> Perhaps pre-load all the class/object names and as the objects/classes are encountered by the engine, load their entire definition at that point?
> I would really like to leverage hibernate for our next project and projects going forward, but this one issue could put a halt on that.
> Thanks for your time.
> I have attached a call tree from Jprofiler to demostrat where the time is being spent. This call tree was generated by running one of our unit tests which requires hibernate to initialize and build the session factory. This configuration was done without caching the mapping files, as I am actually getting better times when I do not serialize the mapping files and most of the time lost is in building the actual session factory, not in the XML parser.
--
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
[Hibernate-JIRA] Closed: (HHH-1340) XML Element and Attribute Names For HBM Should Be Constants
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1340?page=c... ]
Steve Ebersole closed HHH-1340.
-------------------------------
Closing stale resolved issues
> XML Element and Attribute Names For HBM Should Be Constants
> -----------------------------------------------------------
>
> Key: HHH-1340
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1340
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Environment: Hibernate 3
> Reporter: Adam Krouskop
> Priority: Minor
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> It would be nice if the org.hibernate.cfg.HbmBinder class defined constants for all the Element and Attribute names used in the HBM XML Schema.
> Here is the use case prompting this recommendation: I'm using dynamic models to persist maps and I'm generating mappings for these maps at run time, so I'm programmatically creating the <hibernate-mapping> XML. I'd prefer if I could replace my code that looks like this:
> hmE = doc.createElement("hibernate-mapping");
> doc.appendChild(hmE);
> classE = doc.createElement("class");
> classE.setAttribute("entity-name", entity);
> hmE.appendChild(classE);
> ...
> with this:
> hmE = doc.createElement(HbmBinder.HIBERNATE_MAPPING_ELEMENT);
> doc.appendChild(hmE);
> classE = doc.createElement(HbmBinder.CLASS_ELEMENT);
> classE.setAttribute(HbmBinder.ENTITY_NAME_ATTRIBUTE, entity);
> hmE.appendChild(classE);
--
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
[Hibernate-JIRA] Closed: (HHH-1165) Bidirectional many-to-one fails to write the sort column when the collection is a list
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1165?page=c... ]
Steve Ebersole closed HHH-1165.
-------------------------------
Closing stale resolved issues
> Bidirectional many-to-one fails to write the sort column when the collection is a list
> --------------------------------------------------------------------------------------
>
> Key: HHH-1165
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1165
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc2
> Environment: Any
> Reporter: Rich MacDonald
>
> Below is the Person-Address example from the manual adapted to a list collection.
> <class name="Person">
> <id name="id" column="personId">
> <generator class="native"/>
> </id>
> <many-to-one name="address" column="addressId" not-null="true"/>
> </class>
> <class name="Address">
> <id name="id" column="addressId">
> <generator class="native"/>
> </id>
> <list name="people" inverse="true">
> <key column="addressId"/>
> <list-index column="sortOrder"/>
> <one-to-many class="Person"/>
> </list>
> </class>
> In my real application, I require this association to be nullable, since it is part of a table-per-hierarchy mapping. IOW, the Person.addressId and sortOrder column must be nullable. This is irrelevant to the bug, which occurs whether or not the not-null in <many-to-one name="address" column="addressId" not-null="true"/> is true or false.
> The database schema is (firebird format):
> create table Address (addressId numeric(18,0) not null, primary key (addressId))
> create table Person (personId numeric(18,0) not null, addressId numeric(18,0) not null, sortOrder integer, primary key (personId))
> alter table Person add constraint FK8E488775A940C75F foreign key (addressId) references Address
> Note in table Person that addressId is not null, while sortOrder is nullable. That is a bug. Should also be a uniqueness constraint on addressId+sortOrder.
> Create a few objects, fill the association, and save it. You should find that the "sortOrder" column has null values. From the logging:
> insert into Person (addressId, personId) values (?, ?)
> Hibernate: insert into Person (addressId, personId) values (?, ?)
> Dehydrating entity: [example.Person#3]
> LongType:79 - binding '1' to parameter: 1
> LongType:79 - binding '3' to parameter: 2
> Naturally, when the data is read back from the database, the app will fail because it cannot handle a nulled sortOrder.
--
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
[Hibernate-JIRA] Closed: (HHH-1372) Support for MySQL5 new varchar length
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1372?page=c... ]
Steve Ebersole closed HHH-1372.
-------------------------------
Closing stale resolved issues
> Support for MySQL5 new varchar length
> -------------------------------------
>
> Key: HHH-1372
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1372
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3, MySQL5
> Reporter: Marc Batchelor
> Assignee: Steve Ebersole
> Fix For: 3.1.2
>
>
> MySQL5 now supports varchars at 65535 characters. There should probably be a specific Mysql5 dialect to handle this difference between MySql4 and MySql5.
> The code change:
> The constructor currently has these lines for the VARCHAR type:
> ...
> registerColumnType( Types.VARCHAR, "longtext" );
> registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
> registerColumnType( Types.VARCHAR, 65535, "text" );
> registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
> ...
> For MySql5, this section should look like this:
> ...
> registerColumnType( Types.VARCHAR, "longtext" ); //$NON-NLS-1$
> registerColumnType( Types.VARCHAR, 16777215, "mediumtext" ); //$NON-NLS-1$
> registerColumnType( Types.VARCHAR, 65535, "varchar($l)" ); //$NON-NLS-1$
> ...
> It would be pretty handy if the Dialect had an unRegisterColumnType. Then, MySQL5Dialect could subclass MySQLDialect. The constructor could call the super, then unregister the VARCHAR types and re-register 'em as desired. But that's another topic.
--
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