我的配置是
eclipse3.1+Myeclipse 4.1+sqlserver2000

解决方案 »

  1.   

    你的类型映射有错误你的POJO和你的XX.hbm.xml发出来看看
      

  2.   

    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <!-- 
        Mapping file autogenerated by MyEclipse - Hibernate Tools
    -->
    <hibernate-mapping>
        <class name="tmh.database.Dvbm" table="DVBM" schema="dbo" catalog="tmh">
            <id name="dvid" type="long">
                <column name="DVID" />
                <generator class="identity" />
            </id>
            <many-to-one name="dwshx" class="tmh.database.Dwshx" fetch="select">
                <column name="SHXID" />
            </many-to-one>
            <property name="name" type="string">
                <column name="NAME" length="20" not-null="true" />
            </property>
            <property name="address" type="string">
                <column name="ADDRESS" length="40" />
            </property>
            <property name="fr" type="string">
                <column name="FR" length="20" />
            </property>
            <property name="call" type="string">
                <column name="CALL" length="20" />
            </property>
            <property name="telphome" type="string">
                <column name="TELPHOME" length="30" />
            </property>
            <property name="fox" type="string">
                <column name="FOX" length="20" />
            </property>
            <set name="yhjbxxes" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Yhjbxx" />
            </set>
            <set name="pds" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Pd" />
            </set>
            <set name="ggjbxxes" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Ggjbxx" />
            </set>
        </class>
    </hibernate-mapping>
    ===================================================================
    package tmh.database;import java.util.HashSet;
    import java.util.Set;
    /**
     * AbstractDvbm generated by MyEclipse - Hibernate Tools
     */public abstract class AbstractDvbm  implements java.io.Serializable {
        // Fields         private long dvid;
         private Dwshx dwshx;
         private String name;
         private String address;
         private String fr;
         private String call;
         private String telphome;
         private String fox;
         private Set yhjbxxes = new HashSet(0);
         private Set pds = new HashSet(0);
         private Set ggjbxxes = new HashSet(0);
        // Constructors    /** default constructor */
        public AbstractDvbm() {
        } /** minimal constructor */
        public AbstractDvbm(String name) {
            this.name = name;
        }
        
        /** full constructor */
        public AbstractDvbm(Dwshx dwshx, String name, String address, String fr, String call, String telphome, String fox, Set yhjbxxes, Set pds, Set ggjbxxes) {
            this.dwshx = dwshx;
            this.name = name;
            this.address = address;
            this.fr = fr;
            this.call = call;
            this.telphome = telphome;
            this.fox = fox;
            this.yhjbxxes = yhjbxxes;
            this.pds = pds;
            this.ggjbxxes = ggjbxxes;
        }   
        // Property accessors    public long getDvid() {
            return this.dvid;
        }
        
        public void setDvid(long dvid) {
            this.dvid = dvid;
        }    public Dwshx getDwshx() {
            return this.dwshx;
        }
        
        public void setDwshx(Dwshx dwshx) {
            this.dwshx = dwshx;
        }    public String getName() {
            return this.name;
        }
        
        public void setName(String name) {
            this.name = name;
        }    public String getAddress() {
            return this.address;
        }
        
        public void setAddress(String address) {
            this.address = address;
        }    public String getFr() {
            return this.fr;
        }
        
        public void setFr(String fr) {
            this.fr = fr;
        }    public String getCall() {
            return this.call;
        }
        
        public void setCall(String call) {
            this.call = call;
        }    public String getTelphome() {
            return this.telphome;
        }
        
        public void setTelphome(String telphome) {
            this.telphome = telphome;
        }    public String getFox() {
            return this.fox;
        }
        
        public void setFox(String fox) {
            this.fox = fox;
        }    public Set getYhjbxxes() {
            return this.yhjbxxes;
        }
        
        public void setYhjbxxes(Set yhjbxxes) {
            this.yhjbxxes = yhjbxxes;
        }    public Set getPds() {
            return this.pds;
        }
        
        public void setPds(Set pds) {
            this.pds = pds;
        }    public Set getGgjbxxes() {
            return this.ggjbxxes;
        }
        
        public void setGgjbxxes(Set ggjbxxes) {
            this.ggjbxxes = ggjbxxes;
        }
       
    }
      

  3.   

    <set name="yhjbxxes" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Yhjbxx" />
            </set>
            <set name="pds" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Pd" />
            </set>
            <set name="ggjbxxes" inverse="true">
                <key>
                    <column name="DVID" />
                </key>
                <one-to-many class="tmh.database.Ggjbxx" />
            </set>你的这几个set 都对应到DVID一个字段你的逻辑是什么