Hello,
I encounters a problem while using 'ShemaExport' Hibernate
functionnality:
[schemaexport] GRAVE: Could not compile the mapping document
[schemaexport] org.hibernate.MappingException: class
foot.hibernate.Game not found while looking for property: awayTeamScore
Please see below my configuration files:
hibernate.cfg.xml :
<session-factory>
[...]
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">create</property>
<mapping resource="foot/hibernate/Coach.hbm.xml" />
<mapping resource="foot/hibernate/Player.hbm.xml" />
<mapping resource="foot/hibernate/Team.hbm.xml" />
<mapping resource="foot/hibernate/Game.hbm.xml" />
</session-factory>
Game.hbm.xml :
<hibernate-mapping package="foot.hibernate">
<class name="Game" table="GAME" lazy="true">
<id name="gameId" column="GAME_ID" type="java.lang.Long">
<generator class="native"/>
</id>
<property name="awayTeamScore" column="AWAY_TEAM_SCORE" />
<property name="homeTeamScore" column="HOME_TEAM_SCORE" />
<property name="gameDate" column="GAME_DATE" />
<many-to-one cascade="none" name="mostValuablePlayer"
class="Player" column="PLAYER_ID" />
<many-to-one cascade="none" name="homeTeam"
class="Team" column="HOME_TEAM_ID" />
<many-to-one cascade="none" name="awayTeam"
class="Team" column="AWAY_TEAM_ID" />
</class>
</hibernate-mapping>
Game.java :
private int awayTeamScore;
public int getAwayTeamScore() {
return awayTeamScore;
}
public void setAwayTeamScore(int awayTeamScore) {
this.awayTeamScore = awayTeamScore;
}
I don't understand that the class Game is the only Class which creates
problem
Could someone help me ?
--
Marc
jlp - 09 Jan 2006 14:44 GMT
Property awayTeamScore must be a Class and serializable, int is not.
> Hello,
>
[quoted text clipped - 52 lines]
> --
> Marc