我創建了一個hbm.xml文件中,但它給我一個錯誤:Hibernate映射錯誤?
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*,resultset*,(query|sql-query)*)".
下面的代碼:
<?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>
<class name="edu.byu.training.domain.ProductFlsko" table="PRODUCTFLSKO" schema="GAATTRAINING">
<property name="productId" column="PRODUCT_ID"/>
<property name="product" column="PRODUCT"/>
<property name="description" column="DESCRIPTION"/>
<property name="price" column="PRICE"/>
<property name="rowNumber" column="ROW_NUMBER"/>
<query name="get.By.Id" cacheable="true">
select ProductFlsko
from edu.byu.training.domain.ProductFlsko prod
where prod.productId = :id
</query>
</class>
</hibernate-mapping>
我不知道這一點對我的生活..
我在我的'xml'中也有同樣的錯誤。但我的問題是我有2''標籤。刪除其中一個並解決問題。認爲這對面臨同樣問題的其他人有用。 –
Freakyuser
2013-02-01 11:25:14