-->
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: net.sf.hibernate.InstantiationException
PostPosted: Tue Jun 01, 2004 4:31 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
Hi all!

I have created a class which extends java.security.BasicPermission, but when trying to get the list of them from the database, using the list() method, I have the following error:

Code:
net.sf.hibernate.InstantiationException: Could not instantiate entity: es.xxx.xxxx.security.ParsysPermission


Here is the class:

Code:
public class ParsysPermission extends BasicPermission {

   private Long code;
   private String permissionName;
   
   
   public ParsysPermission()
   {
      super("");
   }
      
   
   public boolean equals( Object o )
   {
      
      if( o instanceof ParsysPermission )
      {
         ParsysPermission other = (ParsysPermission) o;
         return (
               (this.code.equals(other.getCode())) &&               
               (this.permissionName.equals(other.getPermissionName()))
         );
      }

      return false;

   }
   
   public int hashCode()
   {
      return code.hashCode() ^ permissionName.hashCode();
   }
   public Long getCode() {
      return code;
   }
   public void setCode(Long code) {
      this.code = code;
   }
   public String getPermissionName() {
      return permissionName;
   }
   public void setPermissionName(String permissionName) {
      this.permissionName = permissionName;
   }
}



And this will be the mapping:
Code:
<class name="es.xxx.xxxx.security.ParsysPermission">
   <id name="code" type="long" column="code" unsaved-value="null">
      <generator class="native" />
    </id>
    <property name="permissionName" type="string" />
</class>


The HQL query I'm trying to create is the following:
Code:
from ParsysPermission as per  order by per.permissionName asc


Why I'm having this exception?

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 5:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Full stack trace

_________________
Emmanuel


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.