日期:2014-05-18  浏览次数:20713 次

一个新手关于hibernate 的问题 id" must match 郁闷啊!!
10:34:20,187     INFO   Configuration:   Reading   mappings   from   resource:   com/iustice/User.hbm.xml

10:34:20,250   ERROR   XMLHelper:   Error   parsing   XML:   XML   InputStream(7)   The   content   of   element   type   "id "   must   match   "(meta*,column*,type?,generator?) ".

10:34:20,250   ERROR   XMLHelper:   Error   parsing   XML:   XML   InputStream(10)   The   content   of   element   type   "class "   must   match   "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natu


<?xml   version= "1.0 "?>
<!DOCTYPE   hibernate-mapping   PUBLIC
"-//Hibernate/Hibernate   Mapping   DTD   3.0//EN "
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd ">
<hibernate-mapping   package= "com.iustice ">
<class   name= "User "   table= "user ">
<id   name= "id "   column= "id ">
  <generator   class= "identity "> </generator>
</id>
<property   name= "username "   column= "username "     unique= "true "/>
<property   name= "password "   column= "password "   />
</class>
</hibernate-mapping>


<?xml   version= '1.0 '   encoding= 'UTF-8 '?>
<!DOCTYPE   hibernate-configuration   PUBLIC
                    "-//Hibernate/Hibernate   Configuration   DTD   3.0//EN "
                    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd ">

<!--   Generated   by   MyEclipse   Hibernate   Tools.                                       -->
<hibernate-configuration>

<session-factory>
<property   name= "connection.url "> jdbc:mysql://localhost/user </property>
<property   name= "connection.driver_class "> org.gjt.mm.mysql.Driver </property>
<property   name= "connection.username "> root </property>
<property   name= "connection.password "> 002312708 </property>

<property   name= "dialect "> org.hibernate.dialect.MySQLDialect </property>
<property   name= "connection.pool_size "> 10 </property>
<property   name= "current_session_context_class "> thread </property>
<property   name= "cache.provider_class "> org.hibernate.cache.NoCacheProvider </property>
<property   name= "show_sql "> true </property>
<!--
<property   name= "hbm2ddl.auto "> create </property>
-->
<mapping   resource= "com/iustice/User.hbm.xml "   />


</session-factory>

</hibernate-configuration>


ublic   cl