-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate message - unmapped class java.math.BigDecimal
PostPosted: Mon Apr 24, 2006 3:31 pm 
Beginner
Beginner

Joined: Thu Jan 12, 2006 6:32 pm
Posts: 39
Location: Austin, Tx, USA, NA, Sol 3
Since when do I have to "map" the java standard data types?

[b]Hibernate version:[/b] 3.1.3

[b]Mapping documents:[/b]

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-cascade="none" default-access="property" auto-import="true">

<class name="us.tx.state.oag.WfPersonnelAction.HbmWfPersonnelActionTable"
table="info_wf_personnel_action" entity-name="info_wf_personnel_action">

<id name="ActionId" type="big_decimal" column="action_id" unsaved-value="null">
<generator class="hilo">
<param name="table">sys_next_ids</param>
<param name="column">next_action_id</param>
</generator>
</id>

<property name="CreationDate" column="creation_date" type="timestamp" update="true" insert="true"/>
<property name="EffectiveDate" column="effective_date" type="timestamp" update="true" insert="true"/>
<property name="HrEmplId" column="hr_emplid" type="string" update="true" insert="true"/>
<property name="HrNameFirst" column="hr_name_first" type="string" update="true" insert="true"/>
<property name="HrNameLast" column="hr_name_last" type="string" update="true" insert="true"/>
<property name="HrPhoneWork" column="hr_phone_work" type="string" update="true" insert="true"/>
<property name="PortalWorkflowId" column="portal_wf_id" type="string" update="true" insert="true"/>
<property name="MgrEmplId" column="mgr_emplid" type="string" update="true" insert="true"/>
<property name="MgrNameFirst" column="mgr_name_first" type="string" update="true" insert="true"/>
<property name="MgrNameLast" column="mgr_name_last" type="string" update="true" insert="true"/>
<property name="MgrPhoneWork" column="mgr_phone_work" type="string" update="true" insert="true"/>

</class>

</hibernate-mapping>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping default-cascade="none" default-access="property" auto-import="true">

<class name="us.tx.state.oag.WfPersonnelAction.HbmWfPaSignaturesTable"
table="info_wf_pa_signatures" entity-name="info_wf_pa_signatures">

<composite-id>
<key-property name="ActionId" column="action_id" type="big_decimal" />
<key-property name="SignatureId" column="signature_id" type="big_decimal" />
</composite-id>

<property name="ApprovalState" column="approval_state" type="string" update="true" insert="true"/>
<property name="EmplId" column="emplid" type="string" update="true" insert="true"/>
<property name="DateSigned" column="date_signed" type="timestamp" update="true" insert="true"/>
<property name="Comments" column="comments" type="string" update="true" insert="true"/>

<many-to-one name="ActionId" column="action_id" not-null="true" update="false" insert="false"/>
</class>

</hibernate-mapping>

[b]Full stack trace of any exception that occurs:[/b]
2006-04-24 14:27:55,812 DEBUG [org.hibernate.cfg.Configuration] processing foreign key constraints
2006-04-24 14:27:55,812 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: info_wf_personnel_action
2006-04-24 14:27:55,812 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: info_wf_personnel_action
2006-04-24 14:27:55,812 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: java.math.BigDecimal
2006-04-24 14:27:55,812 ERROR [org.jboss.hibernate.jmx.Hibernate] Starting failed jboss.jca:service=HibernateAppSec
org.hibernate.MappingException: An association from the table info_wf_pa_signatures refers to an unmapped class: java.math.BigDecimal
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1134)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1052)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:611)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:578)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:416)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
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:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
at org.jboss.Main.boot(Main.java:162)
at org.jboss.Main$1.run(Main.java:423)
at java.lang.Thread.run(Thread.java:534)
2006-04-24 14:27:55,828 WARN [org.jboss.system.ServiceController] Problem starting service jboss.jca:service=HibernateAppSec
org.hibernate.MappingException: An association from the table info_wf_pa_signatures refers to an unmapped class: java.math.BigDecimal
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1134)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1052)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:611)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:578)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 5:21 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
==
<many-to-one name="ActionId" column="action_id" not-null="true" update="false" insert="false"/>
==

1. many to one assumes that it is a mapping for a custom class mapping defined somewhere in the user configuration

2. since the actionId is already mapped there need not be second mapping for the same property of the class;

3. if there is a need to have relationships with Action class then mapping still should be defined in one place only and can be done in 2 ways:
a. via <many-to-one name="action" column="action_id" not-null="true" update="false" insert="false"/>
b. or in the composite key mapping with
<composite-id>
<key-many-to-one name="action" ...

in the both cases getter is supposed to look likethis:
public Action getAction(){..} and accompanied by matching setter

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.