2012-02-15 9 views
0

私のコードのマッピングをxmlリソースから注釈に切り替えて、その例外を取得しました。私はエラーが表示されません。私はあなたが私のコードからそれを把握することができると思います。org.hibernate.InvalidMappingException:リソースからマッピングドキュメントを解析できませんでした

hibernate.cfg.xmlの

<?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"> 
<hibernate-configuration> 
    <session-factory> 
    <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property> 
    <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> 
    <property name="hibernate.connection.url">####</property> 
    <property name="hibernate.connection.username">##</property> 
    <property name="hibernate.connection.password">###</property> 
    <property name="hibernate.current_session_context_class">thread</property> 
    <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> 
    <property name="hibernate.show_sql">true</property> 
    <mapping class="max.Trade" file="" jar="" package="max" resource=""/> 
    </session-factory> 
</hibernate-configuration> 

Trade.java

@Entity 
@Table(name="TRADES", schema="PGT") 
public class Trade implements java.io.Serializable 
{ 
    private long murexId; 
    private String type; 
    private String portfolio; 

    public Trade() { 
    } 

    public Trade(long murexId) { 
     this.murexId = murexId; 
    } 

    public Trade(long murexId, String type, String portfolio) { 
     this.murexId = murexId; 
     this.type = type; 
     this.portfolio = portfolio; } 

    @Id 
    @Column(name="MUREX_ID", unique=true, nullable=false, precision=10, scale=0) 
    public long getMurexId() { 
     return this.murexId; 
    } 

    public void setMurexId(long murexId) { 
     this.murexId = murexId; 
    } 

    @Column(name="TYPE", length=32) 
    public String getType() { 
     return this.type; 
    } 

    public void setType(String type) { 
     this.type = type; 
    } 

    @Column(name="PORTFOLIO", length=32) 
    public String getPortfolio() { 
     return this.portfolio; 
    } 

    public void setPortfolio(String portfolio) { 
     this.portfolio = portfolio; 
    } 

} 

私は本当にすべての助けに感謝します。

ありがとうございます!

答えて

0

<mapping class="max.Trade"/> 
としてマッピング定義(タグ)を交換
関連する問題