Announcement Announcement Module
Collapse
No announcement yet.
Impo question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Impo question

    Code:
    package project2;
    import java.util.List;
    
    
    public class EditBilling {
        private int billno;
        private String currency;
        private String day;
        private Members memberid;
        private Countries countryid;
        private List<Details> details;
        
        public EditBilling() {
        
        }
    
        public void setBillno(int billno) {
            this.billno = billno;
        }
    
        public int getBillno() {
            return billno;
        }
    
        public void setCurrency(String currency) {
            this.currency = currency;
        }
    
        public String getCurrency() {
            return currency;
        }
    
        public void setDay(String day) {
            this.day = day;
        }
    
        public String getDay() {
            return day;
        }
    
        public void setMemberid(Members memberid) {
            this.memberid = memberid;
        }
    
        public Members getMemberid() {
            return memberid;
        }
    
        public void setCountryid(Countries countryid) {
            this.countryid = countryid;
        }
    
        public Countries getCountryid() {
            return countryid;
        }
    
        public void setDetails(List<Details> details) {
            this.details = details;
        }
    
        public List<Details> getDetails() {
            return details;
        }
    }

    can someone create the editbilling.hbm.xml to me?

    I did this

    Code:
    <?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 package="project2" auto-import="true" default-lazy="false">
      <class name="Billing" table="billing">
          <id name="billno"  column="billno" >
       <generator class="increment"/>
    
      </id>
            <property name="currency" column="currency" />
            <property name="day" column="day" />
              <bag name="details">
    <!--cache usage="read-write"/-->
             <key column="billno" />
       
                <one-to-many class="Details"/>
       </bag>
       
     <many-to-one   name="memberid"
             class="Members"
             column="id"
              />
          
       <many-to-one   name="countryid" class="Countries"  column="country_id" />
       
       
       
       
       
       
       
       
      </class>
    </hibernate-mapping>


    <many-to-one name="memberid"
    class="Members"
    column="id"
    />

    <many-to-one name="countryid" class="Countries" column="country_id" /> this two are wrong.
    can someone fix it to me???

    tables are
    billing has billno, it has list of details...also it has id(which is memebrid) takes one member..it also has countryid, which takes a country..
Working...
X