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?
|
|