|
From: <leg...@at...> - 2003-07-09 23:15:48
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Wed, 9 Jul 2003 6:14 PM
That should be <many-to-one>, not <property>
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-167
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-167
Summary: Cannot Handle Circular Subclass Reference
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Components:
core
Versions:
2.0.1
Assignee:
Reporter: Hao Chen
Created: Wed, 9 Jul 2003 10:06 AM
Updated: Wed, 9 Jul 2003 6:14 PM
Description:
A super class has a field whose type is a subclass. Looks like Hibernate failed to load the subclass because the super class has not been initialized.
Can we have a better algorithm to deal with this situation?
==============================================================
My configurations:
<hibernate-mapping>
<class
name="BaseEntity"
dynamic-update="false"
dynamic-insert="false"
>
<id name="id" column="id" type="java.lang.Long">
<generator class="native">
</generator>
</id>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
column="name"
length="100"
not-null="true"
/>
<subclass
name="resource.BaseResource"
dynamic-update="false"
dynamic-insert="false"
>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="description"
length="300"
not-null="true"
/>
<property
name="status"
type="classification.Status"
update="true"
insert="true"
column="status"
not-null="true"
/>
...
<subclass
name="classification.Status"
dynamic-update="false"
dynamic-insert="false"
>
<property
name="description"
type="java.lang.String"
update="true"
insert="true"
column="description"
length="100"
not-null="true"
/>
</subclass>
</subclass>
</class>
</hibernate-mapping>
================================================================================
INFO - Mapping subclass: resource.BaseResource -> BaseEntity
DEBUG - Mapped property: description -> description, type: string
ERROR - Could not compile the mapping document
net.sf.hibernate.MappingException: Could not interpret type: classification.Status
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872)
at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286)
at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29)
at util.HibernateUtil.main(HibernateUtil.java:53)
Exception in thread "main" exception.SystemException: net.sf.hibernate.MappingException: Could not int
erpret type: classification.Status
at util.HibernateUtil.getSessionFactory(HibernateUtil.java:43)
at util.HibernateUtil.main(HibernateUtil.java:53)
Caused by: net.sf.hibernate.MappingException: Could not interpret type: classification.Status
at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872)
at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286)
at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29)
... 1 more
---------------------------------------------------------------------
JIRA INFORMATION:
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.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|