[Hibernate-JIRA] Created: (HHH-2084) Hibernate could not map number(1) to a boolean with direct field access mapping
by Amir Pashazadeh (JIRA)
Hibernate could not map number(1) to a boolean with direct field access mapping
-------------------------------------------------------------------------------
Key: HHH-2084
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2084
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2
Reporter: Amir Pashazadeh
My entity has a boolean property mapped directly to field (no accessors) and it has a proper NUMBER(1) column on database. When fetching the entity following exception occures:
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.payeshgaran.MyClass.myBooleanField
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.payeshgaran.MyClass.myBooleanField
at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:82)
at org.hibernate.tuple.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:330)
at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:191)
...
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HBX-756) EJB3ConfigurationTask.createConfiguration: NoSuchMethodException
by Juergen Zimmermann (JIRA)
EJB3ConfigurationTask.createConfiguration: NoSuchMethodException
----------------------------------------------------------------
Key: HBX-756
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-756
Project: Hibernate Tools
Type: Bug
Components: ant
Versions: 3.2beta8
Environment: JBoss 4.0.4-Patch1 with EJB3_RC8 (includes Hibernate 3.2CR4, Hibernate Annotations 3.2CR2, Hibernate Entity Manager 3.2CR2)
Reporter: Juergen Zimmermann
The DDL should be generated with this ANT task
<hibernatetool destdir="${gen.dir}">
<classpath refid="hbm2ddl.classpath"/>
<ejb3configuration/>
<hbm2ddl outputfilename="create-tables.sql" drop="false" export="false"/>
</hibernatetool>
However, I get this stack trace:
[hibernatetool] java.lang.NoSuchMethodException: org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(java.lang.String, java.util.Map)
C:\Daten\eclipse-workspace\hskaDB\postgresql\build.xml:239: Problems in creating a Ejb3Configuration. Have you remembered to add it to the classpath ?
at org.hibernate.tool.ant.EJB3ConfigurationTask.createConfiguration(EJB3ConfigurationTask.java:37)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:54)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:278)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:45)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:162)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:104)
at org.apache.tools.ant.Task.perform(Task.java:375)
at org.apache.tools.ant.Target.execute(Target.java:356)
at org.apache.tools.ant.Target.performTasks(Target.java:384)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1268)
at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1120)
at org.apache.tools.ant.Main.runBuild(Main.java:697)
at org.apache.tools.ant.Main.startAnt(Main.java:198)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:299)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:105)
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HHH-2080) NodeTraverser throws unhandled IllegalArgumentException on bogus query
by Anders Wallgren (JIRA)
NodeTraverser throws unhandled IllegalArgumentException on bogus query
----------------------------------------------------------------------
Key: HHH-2080
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2080
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.0.cr4
Environment: 3.2.0.cr4, MySQL 5.0
Reporter: Anders Wallgren
One of our unit tests uses a bogus query string to test some error handle. In this case, the query string is "blah" -- I would have expected a QuerySyntaxException here, not an IllegalArgumentException from deep within the HQL parser.
Stack trace from the log:
{code}
2006-09-17T16:00:30.689 | ERROR | main | RunQuery | PARSER | line 1:1: unexpected token: blah
2006-09-17T16:00:30.689 | ERROR | main | RunQuery | OperationInvoker | Operation exception: node to traverse cannot be null!
java.lang.IllegalArgumentException: node to traverse cannot be null!
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
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.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1184)
at $Proxy54.createQuery(Unknown Source)
at com.electriccloud.commander.hibernate.HibernateCommanderDao$4.doInHibernate(HibernateCommanderDao.java:2117)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:327)
at com.electriccloud.commander.hibernate.HibernateCommanderDao.runQuery(HibernateCommanderDao.java:2131)
at com.electriccloud.commander.api.RunQueryOperation.perform(RunQueryOperation.java:71)
at com.electriccloud.commander.operations.OperationInvoker.invoke(OperationInvoker.java:150)
at com.electriccloud.commander.operations.OperationProxyImpl.perform(OperationProxyImpl.java:134)
at com.electriccloud.commander.operations.OperationTestHelper.assertOperationException(OperationTestHelper.java:408)
at com.electriccloud.commander.operations.OperationTestHelper.assertOperationException(OperationTestHelper.java:391)
at com.electriccloud.commander.api.RunQueryOperationTest.testInvalidQuery(RunQueryOperationTest.java:70)
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 junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at junit.textui.TestRunner.doRun(TestRunner.java:115)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
at junit.textui.TestRunner.doRun(TestRunner.java:108)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
{code}
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HBX-752) Add meta attribute property-code, pre/post conditions code
by David Leal (JIRA)
Add meta attribute property-code, pre/post conditions code
----------------------------------------------------------
Key: HBX-752
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-752
Project: Hibernate Tools
Type: Improvement
Components: hbm2java
Versions: 3.2beta7
Reporter: David Leal
Just to suggest to add a new meta attribute like class-code, but for properties. Some times you need to add some pre-condition or post-condition for a set/get method. For example a particular property has to be possitive, not all databases could control this condition, so you have to control it via source code, for example to add a pre-condition on a set operation.
The hbm2java allow to add additional methods/imports, for example via class-code meta attribute, but for the generation properties the user doesn't have any control about the generated code.
My suggestion is to add three possible meta-attributes:
property-get/set-code: For setting the hole generated code for a particular property, with a non-default set/get code generation.
pre-get/set-code: Just add a precondition code to the generated source code.
post-get/set-code: Just add a postcondition code, at the end of the code generation, for a particular property.
All three properties can be specified for get/set operation.
About this topic I have asked to the forum,
http://forum.hibernate.org/viewtopic.php?t=964523#2321689
but the solution was to modify the template, wich in my humble opinion is a kind of brute force for this simple modification.
Thanks in advance,
David Leal
--
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
18 years, 3 months