-->
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.  [ 2 posts ] 
Author Message
 Post subject: CGLIB Enhancement failed
PostPosted: Tue Jun 13, 2006 4:51 am 
Beginner
Beginner

Joined: Tue Feb 07, 2006 10:39 pm
Posts: 46
i have this error:

Quote:
ERROR [org.hibernate.proxy.BasicLazyInitializer] CGLIB Enhancement failed: my.com.shinyang.ilms.model.MCurrency
java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given


my model file is as shown below:

public class MCurrency implements java.io.Serializable, TableData {
Code:

    // Fields   

     private String code;
     private BigDecimal rate;
     private String description;
     private BigDecimal unit;
     private Date fromDate;
     private Date toDate;
     


    // Constructors

    public MCurrency(String code, String description, BigDecimal rate, BigDecimal unit, Date fromDate, Date toDate) {
        this.code = code;
         this.description = description;
         this.rate = rate;
         this.unit = unit;
         this.fromDate = fromDate;
         this.toDate = toDate;
    }

   /** minimal constructor */
    public MCurrency(String code) {
        this.code = code;
    }

   public String getCode() {
      return code;
   }

   public void setCode(String code) {
      this.code = code;
   }

   public String getDescription() {
      return description;
   }

   public void setDescription(String description) {
      this.description = description;
   }

   public Date getFromDate() {
      return fromDate;
   }

   public void setFromDate(Date fromDate) {
      this.fromDate = fromDate;
   }

   public Date getToDate() {
      return toDate;
   }

   public void setToDate(Date toDate) {
      this.toDate = toDate;
   }

   public BigDecimal getRate() {
      return rate;
   }

   public void setRate(BigDecimal rate) {
      this.rate = rate;
   }

   public BigDecimal getUnit() {
      return unit;
   }

   public void setUnit(BigDecimal unit) {
      this.unit = unit;
   }

   
}


can anyone help?? thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 3:44 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
Add a no-argument constructor: public MCurrency() {} and try again.

"The no-argument constructor is a requirement for all persistent classes; Hibernate has to create objects for you, using Java Reflection. The constructor can be private, however, package visibility is required for runtime proxy generation and efficient data retrieval without bytecode instrumentation. " - Hibernate reference


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

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.