-->
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.  [ 1 post ] 
Author Message
 Post subject: polymorphic persistence error
PostPosted: Fri May 23, 2008 5:55 pm 
Newbie

Joined: Fri May 23, 2008 3:23 pm
Posts: 1
Location: Colorado Springs, CO
I am trying to upgrade from hibernate 2 to 3 and one of my existing mappings is giving me errors. It says I need a descriminator for a polymorphic mapping. The mapping I have is not polymorphic though. There is just one class mapped to this table.

SEVERE: AAAA failed to get session:
org.hibernate.MappingException: discriminator mapping required for single table polymorphic persistence
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:267)
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:1300)
at com.foo.domain.internal.HibernatePersistenceToolkit.getSessionFactory(HibernatePersistenceToolkit.java:143)
at com.foo.domain.internal.HibernatePersistenceToolkit.getSession(HibernatePersistenceToolkit.java:151)
at com.foo.domain.internal.HibernatePersistenceToolkit.store(HibernatePersistenceToolkit.java:357)
at com.foo.domain.PersistenceManager.flush(PersistenceManager.java:266)
at com.foo.domain.services.normalization.internal.NormalizedMBeanImpl.flush(NormalizedMBeanImpl.java:2272)
at com.foo.domain.services.normalization.internal.NormalizedMBeanImpl.addUnnormalizedObjectName(NormalizedMBeanImpl.java:573)
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:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:163)
at com.foo.domain.services.normalization.internal.NormalizedMBeanImpl$$EnhancerByCGLIB$$58d33fa6.addUnnormalizedObjectName(<generated>)
at com.foo.domain.services.normalization.internal.NormalizationManager.addMBean(NormalizationManager.java:853)
at com.foo.domain.services.normalization.internal.NormalizationManager.access$200(NormalizationManager.java:72)
at com.foo.domain.services.normalization.internal.NormalizationManager$NormalizationTask$1.run(NormalizationManager.java:1143)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:337)
at com.foo.domain.services.normalization.internal.NormalizationManager$NormalizationTask.run(NormalizationManager.java:1110)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)



The mapping is here:
<hibernate-mapping>
<class name="com.foo.domain.services.normalization.internal.NormalizedMBeanImpl"
table="hd_normalize_mbean">
<id column="object_id" type="long">
<generator class="sequence">
<param name="sequence">seq_hd_object_id</param>
</generator>
</id>
<property name="mbeanInfo" column="mbean_info" type="serializable"
access="field" />
<property name="normalizedName" column="object_name"
type="com.foo.domain.internal.HibernateObjectNameUserType"
access="field" />
<property name="annotationMap" column="annotation_map"
type="serializable" access="field" />
<property name="lockInfo" column="lock_info"
type="serializable" access="field" />
<property name="isNotificationEnabled" column="is_notification_enabled" type="boolean"
access="field" />
<property name="isSensorNotificationEnabled" column="is_sensor_notification_enabled" type="boolean"
access="field" />
<map name="myCorrelationMap" table="hd_correlation_attribute" cascade="all"
access="field">
<key column="resource_object_id" />
<index column="key" type="string" />
<element column="value" type="string" />
</map>

</class>
</hibernate-mapping>

I really don't want to change the table for backward compatibility sake especially since I really shouldn't need a discriminator for just one class. Any ideas?


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

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.