[Hibernate-JIRA] Created: (HHH-2558) Allow batching inserts for multi-table entities
by Steve Ebersole (JIRA)
Allow batching inserts for multi-table entities
-----------------------------------------------
Key: HHH-2558
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2558
Project: Hibernate3
Issue Type: Improvement
Components: core
Reporter: Steve Ebersole
<joined-subclass/> as well as entity's containing <join/> mappings currently cannot participating in JDBC batching. The reaons being that the actions (i.e. Executables) perform the insert or update in an atomic fashion through the persisters; the persisters perform the multiple statements.
One possible approach for solving would be to have the persisters somehow expose the fact that inserts or updates effect multiple tables and to have the actions drive the executions of those statements.
Another possible approach would be to change how Batcher works. Currently, batcher is capable of tracking a single jdbc batch statement, which it does by string comparison of the sql. So a new sql command is seen as the impetus to start a new batch. So we could change this to make batch a logical concept such that the "grouping" is actually at a higher level : like say "[command]:[entity-name](:[id])". Then we could have batches keyed by "update:Customer:1" rather than "update CUSTOMER set ...". Would need to be very careful in the case of dynamic-insert and dynamic-update...
This is a follow-on to HHH-1
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-2336) UserCollectionType: add support for ParameterizedTypes and typedef'ed types to the collection-type attribute for a collection mapping
by Holger Brands (JIRA)
UserCollectionType: add support for ParameterizedTypes and typedef'ed types to the collection-type attribute for a collection mapping
-------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2336
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2336
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.1
Environment: Hibernate 3.2.1, independent of database platform
Reporter: Holger Brands
Attachments: usercollectionwithparameters.zip
Currently, it's required to specify a class name as value for the collection-type attribute of a collection mapping.
Therefore you can't use a typedef'ed type as collection-type and consequently you can't pass parameters to a custom collection type.
Please enhance the support for custom collection types such that you can do something like this:
<typedef name="MyEventListType" class="ca.odell.glazedlists.hibernate.EventListType">
<param name="category">Test</param>
</typedef>
<class name="User" table="`USERS`">
<id name="userName" column="USERNAME"/>
<!-- mapping a value collection -->
<list name="nickNames" table="USER_NICKNAMES"
collection-type="MyEventListType">
<key column="USER_ID"/>
<list-index column="DISPLAY_ORDER"/>
<element column="NAME" type="string" length="50"/>
</list>
</class>
Currently this mapping fails with this exception:
org.hibernate.MappingException: user colllection type class not found: MyEventListType
at org.hibernate.type.TypeFactory.customCollection(TypeFactory.java:267)
at org.hibernate.mapping.Collection.getCollectionType(Collection.java:348)
at org.hibernate.mapping.Collection.getType(Collection.java:340)
at org.hibernate.tuple.PropertyFactory.buildStandardProperty(PropertyFactory.java:120)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:163)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
at ca.odell.glazedlists.hibernate.AbstractHibernateTestCase.buildSessionFactory(AbstractHibernateTestCase.java:133)
at ca.odell.glazedlists.hibernate.AbstractHibernateTestCase.setUp(AbstractHibernateTestCase.java:167)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.ClassNotFoundException: MyEventListType
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.type.TypeFactory.customCollection(TypeFactory.java:264)
... 24 more
Also see the coresponding forum entry for details:
http://forum.hibernate.org/viewtopic.php?t=969043
Attached is a test case that demonstrates this problem.
It's a modified copy of the existing "usercollection" test case in the Hibernate 3.2.1 distribution.
Just copy the directory into your org.hibernate.test directory and include it in your testsuite.
As I'm not familiar enough with the internals of Hibernate, I have no patch at hand, sorry.
Resolving this issue would enhance mapping flexibility for custom collection types because you
would be able to pass parameters as it's possible right now for UserTypes and CompositeUserTypes.
--
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, 10 months