| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| Property awayTeamScore must be a Class and serializable, int is not. "marc" <msiramy@free.fr> a écrit dans le message de news:1136763482.871812.192140@g49g2000cwa.googlegr oups.com... > 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 > |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.