[Hibernate-JIRA] Created: (ANN-650) Explicitly disallow @Version on @Embedded and throw meaningful Exception
by Chris Bredesen (JIRA)
Explicitly disallow @Version on @Embedded and throw meaningful Exception
------------------------------------------------------------------------
Key: ANN-650
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-650
Project: Hibernate Annotations
Issue Type: Improvement
Components: binder
Affects Versions: 3.3.0.ga
Environment: Hibernate Annotations 3.3.0.GA
Hibernate 3.2.2
Hibernate EntityManager 3.3.1.GA
Reporter: Chris Bredesen
Priority: Minor
The above situation should be explicitly checked for and a meaningful exception thrown. Currently, this configuration blows up with the following trace:
java.lang.ArrayIndexOutOfBoundsException: -66
at org.hibernate.persister.entity.AbstractEntityPersister.checkVersion(AbstractEntityPersister.java:1855)
at org.hibernate.persister.entity.AbstractEntityPersister.generateUpdateString(AbstractEntityPersister.java:1811)
at org.hibernate.persister.entity.AbstractEntityPersister.generateUpdateString(AbstractEntityPersister.java:1777)
at org.hibernate.persister.entity.AbstractEntityPersister.postConstruct(AbstractEntityPersister.java:2930)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:409)
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:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
--
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
16 years, 8 months
[Hibernate-JIRA] Created: (ANN-673) Guaranty column order in genereted schema
by Ivo Danihelka (JIRA)
Guaranty column order in genereted schema
-----------------------------------------
Key: ANN-673
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-673
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.2.1, 3.3.1
Environment: Hibernate 3.2.1 and SVN, PostgreSQL 8.1
Reporter: Ivo Danihelka
Priority: Minor
Attachments: fk-order.path
Problem:
- AnnotationConfiguration does not define stable ordering for foreign key columns. They then could appear in generated SQL schema in any order. For example, sometimes table foreign key column person_id is before another foreign key column dog_id and sometimes it is behind it.
Tool hbm2ddl could be used to see the generated schema. The order of foreign key columns in one table changes
when unrelated change is made inside mapping of a different table.
Proposed Solution:
- Don't base the ordering of foreign keys on hashCode. Base it on tableName+propertyName.
A patch against hibernate 3.2.1 is attached (it also backportes #ANN-551 into 3.2.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
16 years, 8 months
[Hibernate-JIRA] Created: (ANN-591) SchemaExport throws ConcurrentModificationException for entity containing list of lists
by Ivan O'Connor (JIRA)
SchemaExport throws ConcurrentModificationException for entity containing list of lists
---------------------------------------------------------------------------------------
Key: ANN-591
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-591
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.2.1
Environment: Hibernate 3.2.1.GA, Oracle 10
Reporter: Ivan O'Connor
Attachments: hbm2ddl.zip
I have a class, let's call it A, that contains a List of class B. Each instance of B has a List of class C. I'm trying to generate the DDL for this, so I've annotated the code and run it through SchemaExport, which throws a ConcurrentModificationException. My environment: Java 1.5, Oracle 10, Hibernate 3.2.1ga.
The problem seems to be caused by having an entity (A) containing an embedded collection (of B), each element of which contains a collection (of C). SchemaExport generates correct DDL when the annotations are modified to make B and/or C an entity, but not when they are both components. I realise this is considered something of an exotic case, but I'd like to know why the DDL doesn't generate.
See bugReport.txt in attached zip for further details.
--
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
16 years, 8 months
[Hibernate-JIRA] Created: (ANN-590) Table name problem
by Eddie Man (JIRA)
Table name problem
------------------
Key: ANN-590
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-590
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.2.1
Reporter: Eddie Man
Priority: Critical
Attachments: src.zip
Problem:
When I run the test.Main in the attachment, an mapping exception thrown while passing the annotation:
Exception in thread "main" org.hibernate.MappingException: Unable to find column with logical name: customerID in ShoppingBasket
at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:383)
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:88)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:63)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:428)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at test.Main.main(Main.java:19)
But when I change the table name of ShoppingBaskets to "Basket", then the problem solved.
--
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
16 years, 8 months
[Hibernate-JIRA] Created: (HBX-938) Graphviz support in hbm2doc does not support Any mappings
by Matt Read (JIRA)
Graphviz support in hbm2doc does not support Any mappings
---------------------------------------------------------
Key: HBX-938
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-938
Project: Hibernate Tools
Issue Type: Bug
Components: doc
Affects Versions: 3.2beta9
Reporter: Matt Read
Ran hbm2doc from with Maven using the following config:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="maven.test.classpath" />
<hibernatetool destdir="target/hbm2doc">
<configuration
configurationfile="src/test/resources/framepersistence/hibernate.cfg.xml" />
<hbm2doc>
<property key="dot.executable" value="c:/work/apps/Graphviz/Graphviz/bin/dot.exe"/>
</hbm2doc>
</hibernatetool>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
Which produced the following error - my mappings contain <any> tags.
12:05:55 ERROR freemarker.runtime -
Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(org.hibernate.mapping.Property) threw an exception when invoked on org.
hibernate.tool.hbm2x.Cfg2HbmTool@7348e
The problematic instruction:
----------
==> if c2h.getHibernateTypeName(property)?exists [on line 62, column 6 in dot/entitygraph.dot.ftl]
in user-directive propertyEdges [on line 32, column 3 in dot/entitygraph.dot.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(org.hibernate.mapping.Prope
rty) threw an exception when invoked on org.hibernate.tool.hbm2x.Cfg2HbmTool@7348e
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.BuiltIn$existsBI._getAsTemplateModel(BuiltIn.java:635)
at freemarker.core.BuiltIn$existsBI.isTrue(BuiltIn.java:646)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Macro$Context.runMacro(Macro.java:164)
at freemarker.core.Environment.visit(Environment.java:537)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:128)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:231)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
at org.hibernate.tool.hbm2x.GenericExporter$1.process(GenericExporter.java:30)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.tool.hbm2x.DocExporter.generateDot(DocExporter.java:182)
at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:151)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.Any([org.hibernate.mapping.Column(cmvSourceTable), org.hibernate.mapping.Col
umn(cmvSourceSID)])
at org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor.handle(DefaultValueVisitor.java:40)
at org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor.accept(DefaultValueVisitor.java:87)
at org.hibernate.mapping.Any.accept(Any.java:67)
at org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(Cfg2HbmTool.java:380)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
... 63 more
[hibernatetool] An exception occurred while running exporter #2:hbm2doc (Generates html schema documentation)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template dot/entitygraph.dot.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.Cfg2HbmTool.getHibernateTypeName(org.hiberna
te.mapping.Property) threw an exception when invoked on org.hibernate.tool.hbm2x.Cfg2HbmTool@7348e
[hibernatetool] java.lang.UnsupportedOperationException: accept on org.hibernate.mapping.Any([org.hibernate.mapping.Column(cmvSourceTable), org.hibernate.mappin
g.Column(cmvSourceSID)])
--
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
16 years, 8 months
[Hibernate-JIRA] Created: (HHH-2890) Hibernate cannot wrap HSQLDB constraint violations exceptions
by Baptiste MATHUS (JIRA)
Hibernate cannot wrap HSQLDB constraint violations exceptions
-------------------------------------------------------------
Key: HHH-2890
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2890
Project: Hibernate3
Issue Type: Sub-task
Components: core
Affects Versions: 3.2.1
Reporter: Baptiste MATHUS
Priority: Minor
Attachments: UnitTestConstraintBug.zip
Since I can't attach a file to a bug that hasn't been logged by me. I'll create a sub-bug, since logging a bug was anyway something I planned to do when I created the testcase.
In the attached zip, you'll find a project that has two entities: Customer and Invoice. An Invoice references a Customer. I show that trying to delete a Customer that's referenced by an invoice doesn't throw a ConstraintViolationException with HSQLDB (1.8.0.7 or 1.7.3.3 gives the same result).
The testcase is in the test package.
I hope this helps tackle the problem. Before logging a bug in the HSQL tracker, I'd really appreciate to have your opinion. Shoud I do it?
FYI, I tested the very same code on Oracle, and the ConstraintViolationException is very well thrown...
--
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
16 years, 8 months