Java Jasper报告和Hibernate,复合键

Java Jasper报告和Hibernate,复合键,java,hibernate,jakarta-ee,netbeans,jasper-reports,Java,Hibernate,Jakarta Ee,Netbeans,Jasper Reports,我正在创建一个利用Hibernate框架的基于web的系统。我已经用netbeans工具创建了hibernate配置和pojo类。它工作得很好,但当我尝试创建jasper report时,问题就出现了 我有一个名为“external_shipping”的表,它有一个复合键。xml映射文件如下所示 <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD

我正在创建一个利用Hibernate框架的基于web的系统。我已经用netbeans工具创建了hibernate配置和pojo类。它工作得很好,但当我尝试创建jasper report时,问题就出现了

我有一个名为“external_shipping”的表,它有一个复合键。xml映射文件如下所示

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Jul 23, 2013 1:34:21 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
    <class name="pojo.ExternalShipping" table="external_shipping" catalog="bit_final_year_project">
        <composite-id name="id" class="pojo.ExternalShippingId">
            <key-property name="agentId" type="int">
                <column name="agent_id" />
            </key-property>
            <key-property name="buyerId" type="int">
                <column name="buyer_id" />
            </key-property>
            <key-property name="shippingId" type="int">
                <column name="shipping_id" />
            </key-property>
        </composite-id>
        <many-to-one name="externalByBuyerId" class="pojo.External" update="false" insert="false" fetch="select">
            <column name="buyer_id" not-null="true" />
        </many-to-one>
        <many-to-one name="externalByAgentId" class="pojo.External" update="false" insert="false" fetch="select">
            <column name="agent_id" not-null="true" />
        </many-to-one>
        <many-to-one name="externalByConsigneeId" class="pojo.External" fetch="select">
            <column name="consignee_id" />
        </many-to-one>
        <many-to-one name="shipping" class="pojo.Shipping" update="false" insert="false" fetch="select">
            <column name="shipping_id" not-null="true" />
        </many-to-one>
    </class>
</hibernate-mapping>
所以,当我尝试在jasper report(netbean插件)中建立连接时,它会给出如下错误

未找到组件类:ExternalShippingId

我将类路径添加为

C:\Users\dell\Documents\NetBeansProject\DocumentManagementProject\src\java


但它给出了同样的错误。有什么想法吗???

类路径必须引用包含.class文件而不是.java源文件的文件夹。

Netbeans没有为ExternalShippingId创建hbm.xml文件
package pojo;
// Generated Jul 23, 2013 1:34:17 PM by Hibernate Tools 3.2.1.GA


import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ExternalShippingId generated by hbm2java
 */
@Embeddable
public class ExternalShippingId  implements java.io.Serializable {


     private int agentId;
     private int buyerId;
     private int shippingId;

    public ExternalShippingId() {
    }

    public ExternalShippingId(int agentId, int buyerId, int shippingId) {
       this.agentId = agentId;
       this.buyerId = buyerId;
       this.shippingId = shippingId;
    }


    @Column(name="agent_id", nullable=false)
    public int getAgentId() {
        return this.agentId;
    }

    public void setAgentId(int agentId) {
        this.agentId = agentId;
    }

    @Column(name="buyer_id", nullable=false)
    public int getBuyerId() {
        return this.buyerId;
    }

    public void setBuyerId(int buyerId) {
        this.buyerId = buyerId;
    }

    @Column(name="shipping_id", nullable=false)
    public int getShippingId() {
        return this.shippingId;
    }

    public void setShippingId(int shippingId) {
        this.shippingId = shippingId;
    }


   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
         if ( (other == null ) ) return false;
         if ( !(other instanceof ExternalShippingId) ) return false;
         ExternalShippingId castOther = ( ExternalShippingId ) other; 

         return (this.getAgentId()==castOther.getAgentId())
 && (this.getBuyerId()==castOther.getBuyerId())
 && (this.getShippingId()==castOther.getShippingId());
   }

   public int hashCode() {
         int result = 17;

         result = 37 * result + this.getAgentId();
         result = 37 * result + this.getBuyerId();
         result = 37 * result + this.getShippingId();
         return result;
   }   


}