-->
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.  [ 4 posts ] 
Author Message
 Post subject: <Sessionfactory error: entity class not found: ....>
PostPosted: Tue Feb 28, 2006 11:58 pm 
Newbie

Joined: Mon Feb 13, 2006 12:30 pm
Posts: 12
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.1

Eclipse version: 3.1

here the error :
<Sessionfactory error: entity class not found: chapter2.Artist >

Here is their mapping :

Track.hbm.xml:
<?xml version="1.0" ?>
<!DOCTYPE hibernate-mapping SYSTEM "E:/OpenSourceLib/hibernate-3.1/src/org/hibernate/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="chapter2.Track" table="TRACK">
<meta attribute="class-description">
Represents a single playable track in the music database
</meta>
<id name="id" type="integer" column="Track_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"></generator>
</id>
<property name="title" type="string">
<meta attribute="use-in-tostring">true</meta>
<column name="TITLE" not-null="true" index="TRACK_TITLE"/>
</property>
<property name="filePath" type="string" not-null="true" />
<property name="playTime" type="time">
<meta attribute="field-description">Playing Time
</meta>
</property>

<set name="artists" table="TRACK_ARTISTS">
<key column="TRACK_ID"/>
<many-to-many class="chapter2.Artist" column="ARTIST_ID"/>
</set>

<property name="added" type="date">
<meta attribute="field-description">When track is created.
</meta>
</property>
<property name="volume" type="short">
<meta attribute="field-description">How loud to play this
</meta>
</property>


</class>

<query name="chapter2.tracksNoLongerThan">
<![CDATA[from chapter2.Track as track
where track.playTime <= :length
]]>
</query>
</hibernate-mapping>

**********************************************

Artist.hbm.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping SYSTEM "E:/OpenSourceLib/hibernate-3.1/src/org/hibernate/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>

<class name="chapter2.Artist" table="ARTIST">
<meta attribute="class-description">
Represents an artist who is associated with a track or album
@author Nguyen Thanh Nha
</meta>

<id name="id" type="integer" column="ARTIST_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native" />
</id>

<property name="name" type="string">
<meta attribute="use-in-tostring">true</meta>
<column name="NAME" not-null="true" unique="true"
index="ARTIST_NAME" />
</property>

<set name="tracks" table="TRACK_ARTISTS" inverse="true">
<meta attribute="field-description">
Tracks by this artist
</meta>
<key column="ARTIST_ID" />
<many-to-many class="chapter2.Track" column="TRACK_ID" />
</set>
</class>
</hibernate-mapping>


when i use code generation, use .java and shema exporter , i found the above error . i run " run schema exporter" on hibernate console , i see every thing is ok , it create track , artist , and track_artist table .
but i don't understand what this error means .
another problem is in source directory , i see track.java ,artist.java, TrackHome.java ,ArtistHome.java .
what is *Home file use for ?
and if i run code generate from command promt ,using ant tool, no home file is create .
can you explain it for me .
Thank in advance .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 12:05 am 
Newbie

Joined: Mon Feb 13, 2006 12:30 pm
Posts: 12
i find a link to the subject that meet the same error .
http://forum.hibernate.org/viewtopic.ph ... tity+class

but , i can't sovle the problem !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 12:15 am 
Newbie

Joined: Mon Feb 13, 2006 12:30 pm
Posts: 12
i just delete the hibernate console and create it again , it sovle the probem for error entity class not found .
but how about home file problem , i can't find it in document .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 12:19 am 
Newbie

Joined: Mon Feb 13, 2006 12:30 pm
Posts: 12
is it because i check "generate dao code" option ?
sorry , i am a newbie .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.