[Hibernate-JIRA] Created: (HHH-2235) Support for null map-keys in <map> mappings
by Igor Lobanov (JIRA)
Support for null map-keys in <map> mappings
-------------------------------------------
Key: HHH-2235
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2235
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.ga
Reporter: Igor Lobanov
Priority: Minor
I'm not sure if I should file it as a bug.
Hibernate requires index column for <map> mappings to be not null. This is required by the code in AbstractCollectionPersister#readIndex(...), which raises exception if index column is null. However, when I override collection persister and force readIndex method to return null, everything seems to work fine. Hibernate allows me to work with maps using null value as a key. Though I havn't tested it extensivly yet.
What is the reason for disallowing null values as a keys? If there are possible complicated error conditions, then this issue is a feature request for null-values support for <map> mappings. If there are no errors possible, then constraining such behavior is probably wrong.
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-2019) Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
by Dave E Martin (JIRA)
Provide a way to unset properties, and/or provide a 'none' option for hbm2ddl.auto
----------------------------------------------------------------------------------
Key: HHH-2019
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2019
Project: Hibernate3
Type: Improvement
Environment: hibernate / annotations / hibernate.properties
Reporter: Dave E Martin
Priority: Minor
It may occasionally be desirable to programmatically get rid of or override a property value, this is generally allowed for by the .setProperty method, however:
Once hbm2ddl.auto is set to something, there is no way to unset it, or set it to a value which would be equivalent to its being unset (or its undocumented). There is no remove or unset, or deleteProperty, and also setting it to null does not work.
Due to issues such as HHH-2018, it may be necessary to programmatically 'get rid of' hbm2ddl.auto even if the end user (or some other mechanism) has specified a value for it in an external hibernate.properties file (or other method of setting hibernate properties).
--
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, 7 months
[Hibernate-JIRA] Created: (HBX-865) ClassValidator cannot be instantiated while trying to open a new Session
by Christian Laakmann (JIRA)
ClassValidator cannot be instantiated while trying to open a new Session
------------------------------------------------------------------------
Key: HBX-865
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-865
Project: Hibernate Tools
Type: Bug
Versions: 3.2beta9
Environment: Hibernate 3.2, Hibernate Tools 3.2beta9 and most recent Nightly
DB: MSSQL Server 2000 & HSQLDB
Reporter: Christian Laakmann
Attachments: Test.java, hibernate.cfg.xml
When I use the @NotEmpty Validator on a String property, Hibernate Tools is unable to open a new Session because the ClassValidator could not be instantiated.
Workaround was to replace @NotEmpty with @NotNull.
see also: http://forum.hibernate.org/viewtopic.php?p=2339708#2339708
Stack-Trace:
java.lang.IllegalArgumentException: could not instantiate ClassValidator
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:287)
at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107)
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66)
at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283)
... 16 more
java.util.MissingResourceException: Can't find resource in validator bundles, key validator.notEmpty
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.replace(DefaultMessageInterpolator.java:107)
at org.hibernate.validator.interpolator.DefaultMessageInterpolator.initialize(DefaultMessageInterpolator.java:66)
at org.hibernate.validator.interpolator.DefaultMessageInterpolatorAggerator.addInterpolator(DefaultMessageInterpolatorAggerator.java:37)
at org.hibernate.validator.ClassValidator.createValidator(ClassValidator.java:283)
at org.hibernate.validator.ClassValidator.createMemberValidator(ClassValidator.java:255)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:127)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:317)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:312)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
--
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, 7 months
[Hibernate-JIRA] Created: (ANN-495) Provide access to IndexWriter.optimize()
by Emmanuel Bernard (JIRA)
Provide access to IndexWriter.optimize()
----------------------------------------
Key: ANN-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-495
Project: Hibernate Annotations
Type: New Feature
Components: lucene
Reporter: Emmanuel Bernard
Fix For: 3.3.0.Alpha1
The problem is not solved "automatically" yet. But here is the reason why.
First of all, the elements are properly deleted, and the index file reflect that as soon as IndexReader.close() is called (which is done by Hibernate Search). However, the files containing the document data are not cleaned.
Basically, to physically delete the elements, you need to optimize() your index, this operation typically takes more time and doing it for every single delete is not appropriate.
I see 4 solutions:
1. let the user access the Directory and call the indexWriter.optimize() method. It works today but it sucks.
2. add an FullTextSession.optimize(Class) method, and the application is responsible for the method trigger. This is the easy solution but put more work on the user. And I'm not happy to push a maintenance API to the Session. Esp since this is more of a SessionFactory like API.
2bis. publish this API through JMX
3. optimize every N operations. It is trivial to add a counter per DirectoryProvider and trigger the optimization. N should be customizable
4. optimize every N seconds. either by setting a timer in an additional thread or wait for the next operation and compare the timestamp
2(bis or not) and 3 are my favorites. It's really 2 or 3 hours of work. If someone is interested, ping me.
--
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, 7 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, 8 months
[Hibernate-JIRA] Created: (HHH-2316) org.hibernate.cache.CacheKey.equals() can cause PropertyAccessException to be thrown
by Joel Caplin (JIRA)
org.hibernate.cache.CacheKey.equals() can cause PropertyAccessException to be thrown
------------------------------------------------------------------------------------
Key: HHH-2316
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2316
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.1
Environment: Windows XP / Sybase 12.5 / Java 1.5.0_09 / ehcache 1.2.4
Reporter: Joel Caplin
Priority: Critical
org.hibernate.cache.CacheKey.equals() uses lazy evaluation in its return clause: it first calls type.isEqual() and, if true, then calls entityOrRoleName.equals().
I am having difficulty reproducing this bug in the form of a test case owing to the complexity of our model and the large amount of data in question-- however, in certain circumstances, where the entityOrRoleName's are NOT equal, calling type.isEqual() yields a PropertyAccessException.
When this bug manifests itself (a PropertyAccessException is thrown), it causes ALL future Hibernate requests to throw a similar exception, thus rendering our service unusable.
This is fixed when the lazy evaluation is done the other way around: call entityOrRoleName.equals() prior to type.isEqual() - cheap string comparision vs an expensive call which has a large call tree under it.
--
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