-->
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.  [ 3 posts ] 
Author Message
 Post subject: Console does not find an Inner Class [Hibernate tools]
PostPosted: Wed Mar 16, 2005 1:24 pm 
Beginner
Beginner

Joined: Thu Dec 23, 2004 8:47 am
Posts: 32
Location: Brazil State:Rio Grande do Sul City:Porto Alegre
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:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 3:54 pm 
Beginner
Beginner

Joined: Thu Dec 23, 2004 8:47 am
Posts: 32
Location: Brazil State:Rio Grande do Sul City:Porto Alegre
There is Anybody with the same problem?

Do you have an example with Console + a relationship many-to-many
with two one to many ?!


Thanks !!!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 5:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
besides i havent any idea why you are using hibernate2.dtd in a hibernate3 tool then i'll suggest that you ensure that the console has a classpath that includes the built domain classes.

_________________
Max
Don't forget to rate


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

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.