-->
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.  [ 3 posts ] 
Author Message
 Post subject: Annotations and Duplicate class/entity mapping problem
PostPosted: Fri Dec 29, 2006 4:57 pm 
Newbie

Joined: Wed Dec 06, 2006 5:27 pm
Posts: 3
Location: Argentina(Cordoba)
Hi:
i'm having a problem with annotations. the problem is shown below:

Code:
17:32:36,765 INFO  [AnnotationBinder] Binding entity from annotated class: com.santex.platform.core.model.hierarchies.HierarchyNode
17:32:36,765 INFO  [Mappings] duplicate import: com.santex.platform.core.model.hierarchies.HierarchyNode->HierarchyNode
17:32:36,765 INFO  [Mappings] duplicate import: com.santex.platform.core.model.hierarchies.HierarchyNode->com.santex.platform.core.model.hierarchies.HierarchyNode
17:32:36,765 INFO  [EntityBinder] Bind entity com.santex.platform.core.model.hierarchies.HierarchyNode on table hierarchy_node
17:32:36,765 ERROR [[/darwin]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: could not deploy a process definition
   at org.jboss.seam.core.Jbpm.installProcessDefinitions(Jbpm.java:235)
   at org.jboss.seam.core.Jbpm.startup(Jbpm.java:66)
   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.jboss.seam.util.Reflections.invoke(Reflections.java:18)
   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
   at org.jboss.seam.Component.callComponentMethod(Component.java:1791)
   at org.jboss.seam.Component.callCreateMethod(Component.java:1739)
   at org.jboss.seam.Component.newInstance(Component.java:1728)
   at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:152)
   at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:126)
   at org.jboss.seam.init.Initialization.init(Initialization.java:430)
   at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
   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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
   at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
   at org.jboss.web.WebModule.startModule(WebModule.java:83)
   at org.jboss.web.WebModule.startService(WebModule.java:61)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
   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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:417)
   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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy98.start(Unknown Source)
   at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
   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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
   at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
   at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
   at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
   at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy99.start(Unknown Source)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
   at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy6.deploy(Unknown Source)
   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.santex.platform.core.model.hierarchies.HierarchyNode
   at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:740)
   at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
   at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
   at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
   at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
   at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:217)
   at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
   at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
   at org.jboss.seam.core.Jbpm.installProcessDefinitions(Jbpm.java:230)
   ... 105 more



exactly, the problem is

"Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.santex.platform.core.model.hierarchies.HierarchyNode"

My hibernate.cfg.xml is :


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

   <session-factory>
      <property name="configurationClass">
         org.hibernate.cfg.AnnotationConfiguration
      </property>
      <property name="hibernate.connection.driver_class">
         com.mysql.jdbc.Driver
      </property>
      <property name="hibernate.connection.url">
         jdbc:mysql://localhost:3306/darwin
      </property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password"></property>
      <property name="hibernate.dialect">
         org.hibernate.dialect.MySQLDialect
      </property>
      <property name="hibernate.hbm2ddl.auto">update</property>
      <property name="hibernate.show_sql">false</property>
      <property name="transaction.factory_class">
         org.hibernate.transaction.JTATransactionFactory
      </property>
      <property name="transaction.manager_lookup_class">
         org.hibernate.transaction.JBossTransactionManagerLookup
      </property>
      <property name="cache.provider_class">
         org.hibernate.cache.HashtableCacheProvider
      </property>

      <!-- hql queries and type defs -->
      <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />

      <!-- graph.def mapping files -->
      <mapping
         resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/Node.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/Transition.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/Event.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/Action.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml" />
      <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml" />
      <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml" />

      <!-- graph.node mapping files -->
      <mapping resource="org/jbpm/graph/node/StartState.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/EndState.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/Decision.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/Fork.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/Join.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/State.hbm.xml" />
      <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml" />

      <!-- context.def mapping files -->
      <mapping
         resource="org/jbpm/context/def/ContextDefinition.hbm.xml" />
      <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml" />

      <!-- taskmgmt.def mapping files -->
      <mapping
         resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml" />
      <mapping
         resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml" />

      <!-- module.def mapping files -->
      <mapping
         resource="org/jbpm/module/def/ModuleDefinition.hbm.xml" />

      <!-- bytes mapping files -->
      <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml" />

      <!-- file.def mapping files -->
      <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml" />

      <!-- scheduler.def mapping files -->
      <mapping
         resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml" />
      <mapping
         resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml" />

      <!-- graph.exe mapping files -->
      <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml" />
      <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml" />
      <mapping resource="org/jbpm/graph/exe/Token.hbm.xml" />
      <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml" />

      <!-- module.exe mapping files -->
      <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml" />

      <!-- context.exe mapping files -->
      <mapping
         resource="org/jbpm/context/exe/ContextInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/VariableInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml" />
      <mapping
         resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml" />

      <!-- msg.db mapping files -->
      <mapping resource="org/jbpm/msg/Message.hbm.xml" />
      <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml" />
      <mapping
         resource="org/jbpm/command/ExecuteActionCommand.hbm.xml" />
      <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml" />
      <mapping resource="org/jbpm/command/SignalCommand.hbm.xml" />
      <mapping
         resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml" />

      <!-- taskmgmt.exe mapping files -->
      <mapping
         resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml" />
      <mapping
         resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml" />

      <!-- scheduler.exe mapping files -->
      <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml" />

      <!-- logging mapping files -->
      <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml" />
      <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml" />
      <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml" />
      <mapping
         resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml" />
      <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml" />
      <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/VariableCreateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml" />
      <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml" />
      <mapping
         resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml" />
      <mapping
         resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml" />


      <!-- Workflow definition tables -->
      <mapping
         class="com.santex.darwin.core.workflow.definition.ActivityDefinitionBase" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.WorkflowDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.TeamType" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.Transition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.WorkflowState" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.VersionInfo" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.RepositoryInfo" />

      <!-- Workflow definition node types -->
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.ApprovalActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.AssignmentActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.ClosingActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.CreationActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.EndActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.StartActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.UpdateActivityDefinition" />
      <mapping
         class="com.santex.darwin.core.workflow.definition.activity.WorkActivityDefinition" />

      <!-- Workflow instances tables -->
      <mapping
         class="com.santex.darwin.core.workflow.instance.ActivityInstanceBase" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.WorkflowInstance" />

      <!-- Workflow definition node types-->
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.ApprovalActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.AssignmentActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.ClosingActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.CreationActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.EndActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.StartActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.UpdateActivityInstance" />
      <mapping
         class="com.santex.darwin.core.workflow.instance.activity.WorkActivityInstance" />


<!-- XXXXXXXXXXXXXXXXXXXX -->
      <!--  classes to generate -->
      <mapping class="com.santex.darwin.core.model.AppUser" />
      <mapping class="com.santex.darwin.core.model.Role" />
      <mapping class="com.santex.darwin.core.model.RoleDefinition" />
      <mapping class="com.santex.darwin.core.model.UserProfile" />
      <mapping class="com.santex.darwin.core.model.security.AppItem" />



      <!-- also generate for classes in platform-->
      <mapping class="com.santex.platform.core.model.ExampleObject" />

      <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyGroupDef" />
   <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyNode" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyNodeDef" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyNodeGroup" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyNodeParentage" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.HierarchyNodeParentageDef" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.CustomAttr" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.CustomAttrDef" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.CustomAttrGroup" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.CustomAttrGroupDef" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.CustomValue" />
      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.ValueType" />

      <mapping
         class="com.santex.platform.core.model.hierarchies.attributes.ValueType" />


      <!-- dynamic fields -->
      <mapping
         class="com.santex.platform.core.model.dynamicField.DynamicFieldsBean" />
      <mapping
         class="com.santex.platform.core.model.dynamicField.DynamicFieldsGroupDef" />
      <mapping
         class="com.santex.platform.core.model.dynamicField.DynamicFieldDef" />
      <mapping
         class="com.santex.platform.core.model.dynamicField.DynamicFieldDefPK" />

      
      <mapping
         class="com.santex.platform.example.dynamicField.DynamicFieldsPojoExample" />



      
   </session-factory>
</hibernate-configuration>


as you can see , the hierarchynode mapping don't appears twice. the HierarchyNode code is :
Code:
package com.santex.platform.core.model.hierarchies;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.santex.platform.core.model.UIdBaseObject;
import com.santex.platform.core.model.hierarchies.attributes.CustomAttrGroup;

/**
* Represents a node in a hierarchy.
*
* @author Agustin Ullio.
*/
@Entity
@Table(name = "hierarchy_node")
@Inheritance(strategy=InheritanceType.JOINED)
public class HierarchyNode extends UIdBaseObject
{
    private static final long serialVersionUID = 9033711058671274026L;

    private String name;
    private HierarchyNodeDef definition;
    private CustomAttrGroup attrGroup;
    private Set<HierarchyNode> children = new HashSet<HierarchyNode>();

    public void setChildren(final Collection<? extends HierarchyNode> pChildren)
    {
        children.addAll(pChildren);
    }

    @Transient
    public Set<HierarchyNode> getChildren()
    {
        return children;
    }

    /**
     * @return the custom attr group
     */
    @ManyToOne(targetEntity = CustomAttrGroup.class)
    @JoinColumn(name = "attrGroup_id")
    public CustomAttrGroup getAttrGroup()
    {
        return attrGroup;
    }

    /**
     * @param attrGroup
     *            the attrGroup to set
     */
    public void setAttrGroup(final CustomAttrGroup pAttrGroup)
    {
        attrGroup = pAttrGroup;
    }

    /**
     * @return the definition
     */
    @ManyToOne(targetEntity = HierarchyNodeDef.class)
    @JoinColumn(name = "definition_id")
    public HierarchyNodeDef getDefinition()
    {
        return definition;
    }

    /**
     * @param definition
     *            the definition to set
     */
    public void setDefinition(final HierarchyNodeDef pDefinition)
    {
        definition = pDefinition;
    }

    /**
     * @return the name
     */
    @Column(name = "global_key", unique = false, nullable = false)
    public String getName()
    {
        return name;
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(final String pName)
    {
        name = pName;
    }

    @Override
    public String toString()
    {
        return name;
    }
}



reading in various posts i found that one cause of this problem is the inheritance, which is ok in HierarchyNode according to those posts (Inheritance JOINED).
anyone help me.
Thanks from Argentina and Happy new Year 2007!!!!!

_________________
----------------------------------------
"mmmm, beer..."
Homer Simpson
----------------------------------------


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 7:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
set the logs to debug to see where the duplicate culprit comes from

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 11:11 am 
Newbie

Joined: Wed Dec 06, 2006 5:27 pm
Posts: 3
Location: Argentina(Cordoba)
thanks, for the response.
my problem was a change of package.
Specifically, i compile the project with the class in a a.b.c package. then i moved the class to the c.d.e package, but eclipse didn't clean the previous .class file generated.
i clean the project and all works fine now

-----------------------------------------------
WELCOME 2007!
-----------------------------------------------

_________________
----------------------------------------
"mmmm, beer..."
Homer Simpson
----------------------------------------


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.