Hibernate version:2.1x
Name and version of the database you are using:Oracle 9i
Hello:
I have problems when mapping a joined-subclass table per subclass with xdoclet @hibernate.joined-subclass.
The doclet writes well in the mapping xml file accord the specifications dtd, and the application load well the sessionFactory and configuration instance, but when i try to execute any hql hibernate query in this particular class or subclass (no in other) the next exception will throw me:
net.sf.hibernate.exception.SQLGrammarException: Could not execute query java.sql.SQLException: ORA-00942: table or view does not exist
If remove the subclass the problem fixed out but is not that i hope, because nedeed this mapping.
Also I'm monitoring the mappings and hql query by hibern8IDE. The exception describe it above came the hibern8IDE.
This is the domain subclass :
/** * @hibernate.joined-subclass * @hibernate.joined-subclass-key column="id" * @hibernate.query name="retriveNewsUserProfile" query="select e from ExtentionsDocument e left join e.topicSource top where e.site = :site and top.id = :source order by e.publicDate desc" * @hibernate.query name="retriveNewsAdminProfile" query="select ext from ExtentionsDocument ext left join ext.topicSource top where top.id = :source order by ext.publicDate desc" * @version $Revision: 1.1 $ $Date: 2005/07/21 19:31:23 $ */ public class ExtentionsDocument extends Document{
/**Id*/ private Long id; /**Content of new*/ private String contentNews;
/** * Creates a new ExtentionsDocument object. */ private String subtitle;
public ExtentionsDocument() { super(); }
/** * @hibernate.property name="getContentNews" column="contentnews" type="java.lang.String" * * @return String */ public String getContentNews() { return contentNews; }
/** * * @param contentNews */ public void setContentNews(String contentNews) { this.contentNews = contentNews; } /** * @hibernate.property name="getSubtitle" column="subtitle" type="java.lang.String" * * @return java.lang.String */ public String getSubtitle() { return subtitle; }
/** * @param subtitle */ public void setSubtitle(String subtitle) { this.subtitle = subtitle; }
/** * Get id property. * * Note: unsaved-value An identifier property value that indicates that an instance * is newly instantiated (unsaved), distinguishing it from transient instances that * were saved or loaded in a previous session. If not specified you will get an exception like this: * another object associated with the session has the same identifier * * @hibernate * .id generator-class="sequence" type="java.lang.Long" column="id" unsaved-value="null" * @hibernate * .generator-param * name = "sequence" * value="document_sequence" * * @return java.lang.Long */ public Long getId() { return id; }
/** * Setter */ public void setId(Long id) { this.id = id; } }
This is the mapping xml generated by xdoclet
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping > <class name="com.sony.bplaextranet.entities.productInfo.Document" table="document" dynamic-update="false" dynamic-insert="false" select-before-update="false" optimistic-lock="version" >
<id name="id" column="id" type="java.lang.Long" unsaved-value="null" > <generator class="sequence"> <param name="sequence">document_sequence</param> <!-- To add non XDoclet generator parameters, create a file named hibernate-generator-params-Document.xml containing the additional parameters and place it in your merge dir. --> </generator> </id>
<property name="title" type="java.lang.String" update="true" insert="true" access="property" column="title" not-null="false" unique="false" />
<many-to-one name="category" class="com.sony.bplaextranet.entities.productInfo.Category" cascade="none" outer-join="auto" update="true" insert="true" access="property" column="category_id" />
<set name="countries" table="country_doc" lazy="true" inverse="false" cascade="all-delete-orphan" sort="unsorted" >
<key column="Document_ID" > </key>
<many-to-many class="com.sony.bplaextranet.entities.Country" column="id_country" outer-join="auto" />
</set>
<set name="plChRelationships" table="pl_channel_doc" lazy="true" inverse="false" cascade="all-delete-orphan" sort="unsorted" >
<key column="id_document" > </key>
<many-to-many class="com.sony.bplaextranet.entities.productInfo.PlChRelation" column="id_pl_channel" outer-join="auto" />
</set>
<property name="contentType" type="java.lang.String" update="true" insert="true" access="property" column="contentType" not-null="false" unique="false" />
<property name="fileName" type="java.lang.String" update="true" insert="true" access="property" column="FileName" not-null="false" unique="false" />
<property name="type" type="java.lang.String" update="true" insert="true" access="property" column="Type" not-null="false" unique="false" />
<property name="createDate" type="java.util.Date" update="true" insert="true" access="property" column="createDate" not-null="false" unique="false" />
<set name="topicSource" table="document_topic" lazy="true" inverse="true" cascade="all-delete-orphan" sort="unsorted" >
<key column="Document_ID" > </key>
<many-to-many class="com.sony.bplaextranet.entities.TopicSource" column="topic_source_id" outer-join="auto" />
</set>
<property name="publicDate" type="java.util.Date" update="true" insert="true" access="property" column="publicDate" />
<property name="site" type="java.lang.String" update="true" insert="true" access="property" column="site" />
<property name="state" type="java.lang.Boolean" update="true" insert="true" access="property" column="state" />
<many-to-one name="subCategory" class="com.sony.bplaextranet.entities.SubCategory" cascade="none" outer-join="auto" update="true" insert="true" access="property" column="subcategory_id" />
<!-- To add non XDoclet property mappings, create a file named hibernate-properties-Document.xml containing the additional properties and place it in your merge dir. -->
<joined-subclass name="com.sony.bplaextranet.entities.productInfo.ExtentionsDocument" dynamic-update="false" dynamic-insert="false" > <key column="id" /> <property name="contentNews" type="java.lang.String" update="true" insert="true" access="property" column="contentnews" />
<property name="subtitle" type="java.lang.String" update="true" insert="true" access="property" column="subtitle" />
</joined-subclass>
</class>
</hibernate-mapping>
I need somebody help with this problem because not found the solution.
Thanks
|