-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Some Problem with Set Attribute
PostPosted: Sat Oct 06, 2012 6:01 am 
Newbie

Joined: Sat Oct 06, 2012 5:28 am
Posts: 1
While I am trying to run the following code i am getting ora-1400 error
even i am setting the values in set.

Please any body tell me where did i done the mistake

thanks in advance
Code:
<!--Customer.hbm.xml-->

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
   <class name="com.santhu.customer.Customer" table="Customer">
      <id name="cno" column="cno">
         <generator class="increment">
         
         </generator>
      </id>
      <property name="cname"/>
      <property name="ctype"/>
      <property name="cphno"/>
      <property name="cpselect" column="cpanel"/>
      <property name="cdob"/>
      <property name="caddress"/>
      <joined-subclass name="com.santhu.customer.BookedCustomer" table="BookedCustomer">
      <key column="cno"/>
      <property name="cadvpaid" column="adv"/>
      <property name="ctobepaid" column="balance"/>
      <property name="dos"/>
      </joined-subclass>
      <joined-subclass name="com.santhu.customer.SoldCustomer" table="SoldCustomer">
      <key column="cno"/>
      <property name="cpaidamt" column="adv"/>
      <property name="cdue" column="due"/>
      <property name="cdstatus" column="dstatus"/>
      <property name="doi"/>
      <set name="bsno" table="sold_batteries">
      <key column="cno"/>
      <element column="sno" type="string"/>
      </set>
      <property name="itype"/>
      <property name="iname"/>
      <property name="pname"/>
      <property name="icapacity"/>
      </joined-subclass>

   </class>
</hibernate-mapping>

Code:
package com.santhu.customer;
import java.util.*;

public class SoldCustomer extends Customer{

   private double cpaidamt,cdue;   

   private String doi,itype,icapacity,iname,pname,cdstatus;
   
   Set<String> bsno;

   public void setCpaidamt(double ap){

      this.cpaidamt=ap;
   }
   public void setCdue(double ap){

      this.cdue=ap;
   }
   public void setCdstatus(String ap){

      this.cdstatus=ap;
   }
   public void setIname(String ap){

      this.iname=ap;
   }
   public void setPname(String ap){

      this.pname=ap;
   }

   public void setDoi(String ap){

      this.doi=ap;
   }
   public void setBsno(Set<String> ap){

      this.bsno=ap;
   }
   public void setItype(String ap){

      this.itype=ap;
   }

   public void setIcapacity(String ap){

      this.icapacity=ap;
   }
   public double getCpaidamt(){

      return cpaidamt;
   }
   public double getCdue(){

      return cdue;
   }
   public String getCdstatus(){

      return cdstatus;
   }
   public String getDoi(){

      return doi;
   }
   public Set<String> getBsno(){

      return bsno;
   }
   public String getItype(){

      return itype;
   }
   public String getIname(){

      return iname;
   }
   public String getPname(){

      return pname;
   }
   public String getIcapacity(){

      return icapacity;
   }
}
Code:
SoldCustomer b=new SoldCustomer();
      b.setCphno("9581333343");
      b.setCname("narezh");
      b.setCaddress("12-213/A bullabai nagar tapeswaram");
      b.setCtype("net customer");
      b.setCdob("31/06/2012");
      b.setCpselect("200P");
      b.setCpaidamt(25920);
      b.setCdue(0);
      b.setCdstatus("YES");
      b.setDoi("25/06/12");
      Set ls=new HashSet();
      ls.add("103");
      ls.add("104");
      b.setBsno(ls);
      b.setItype("500VA");
      b.setIcapacity("24V");
      b.setIname("sun");
      b.setPname("konerus");
      System.out.println("batteries"+b.getBsno().toString());
      bt.sale(b);
      


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.