例外,在這裏的hbm.xml
<generator class="increment" />
<id name="id" />
<property name="movie" />
<property name="showtimes" />
<property name="seatno" />
</class>
Exception
ERROR: HHH000196: Error parsing XML (2) : The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,fetch-profile*,resultset*,(query|sql-query)*)".
Exception in thread "main" org.hibernate.InvalidMappingException: Unable to read XML
at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:375)
at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:304)
at org.hibernate.cfg.Configuration.add(Configuration.java:516)
at org.hibernate.cfg.Configuration.add(Configuration.java:512)
at org.hibernate.cfg.Configuration.add(Configuration.java:686)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:769)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2255)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2227)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2207)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2160)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2075)
at test.ClientUsingAssigned.main(ClientUsingAssigned.java:16)
請提供完整的XML文件。 – Berger
<!DOCTYPE hibernate-mapping PUBLIC 「 - // Hibernate/Hibernate Mapping DTD 3.0 // EN」 「http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd」> <類名= 「beans.BookMovie」 表= 「tbook」 模式= 「系統」> \t <發生器類= 「增量」/> <屬性名稱= 「電影」/> <屬性名= 「放映時間」/> <屬性名= 「seatno」/> 休眠映射> –
uday
嗯...在問題,沒有t作爲評論! –