The Error
Problem while executing Create SessionFactory(org.hibernate.MappingException: org.hibernate.MappingException: class menu.MenuLanguage$Id not found while looking for property: menuId)
MenuLanguage$Id does not have any Xml, and what should I do !?
Hibernate version: 3.0
Mapping documents:
MENU
<?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="menu.Menu"
table="MENU"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<id
name="id"
column="cd_menu"
type="java.lang.Long"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Menu.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<set
name="menuLanguage"
lazy="true"
inverse="true"
cascade="save-update"
sort="unsorted"
>
<key
column="cd_menu"
>
</key>
<one-to-many
class="menu.MenuLanguage"
/>
</set>
<set
name="childMenus"
lazy="true"
inverse="true"
cascade="save-update"
sort="unsorted"
>
<key
column="cd_menu_parent"
>
</key>
<one-to-many
class="menu.Menu"
/>
</set>
<many-to-one
name="parentMenu"
class="menu.Menu"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="cd_menu_parent"
/>
<property
name="cdUserRecord"
type="java.lang.Long"
update="true"
insert="true"
access="property"
column="cd_user_record"
not-null="true"
/>
<property
name="cdUserUpdate"
type="java.lang.Long"
update="true"
insert="true"
access="property"
column="cd_user_update"
not-null="true"
/>
<property
name="dsMenuId"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="ds_menu_id"
length="16"
not-null="true"
/>
<property
name="dtDeactivate"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="dt_deactivate"
/>
<property
name="dtRecord"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="dt_record"
/>
<property
name="dtUpdate"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="dt_update"
/>
<property
name="nrOrder"
type="int"
update="true"
insert="true"
access="property"
column="nr_order"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Menu.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
MENU_LANGUAGE
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="menu.MenuLanguage"
table="MENU_LANGUAGE"
lazy="true">
<composite-id name="id" class="menu.MenuLanguage$Id"
unsaved-value="any">
<key-property name="menuId"
column="cd_menu"/>
<key-property name="languageId"
column="cd_language"
/>
</composite-id>
<many-to-one name="menu"
insert="false"
update="false"
not-null="true"
column="cd_menu"/>
<many-to-one name="language"
insert="false"
update="false"
not-null="true"
column="cd_language"/>
</class>
</hibernate-mapping>
LANGUAGE
<?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="menu.Language"
table="LANGUAGE"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<id
name="id"
column="cd_language"
type="java.lang.Long"
>
<generator class="native">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Language.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<set
name="menuLanguage"
lazy="true"
inverse="true"
cascade="save-update"
sort="unsorted"
>
<key
column="cd_language"
>
</key>
<one-to-many
class="menu.MenuLanguage"
/>
</set>
<property
name="dsLanguage"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="ds_language"
length="16"
not-null="true"
/>
<property
name="dsLanguageId"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="ds_language_id"
length="5"
not-null="true"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Language.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|