-->
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: Problem with getClass()
PostPosted: Thu Sep 27, 2007 12:02 pm 
Beginner
Beginner

Joined: Tue Aug 21, 2007 4:58 am
Posts: 30
Hello,

When I try to get an attributeĀ“s class I get something really weird and I donĀ“t undertand why.
This is why I get com.telvent.padron.ge.model.Expediente$$EnhancerByCGLIB$$e395658
I should get
com.telvent.padron.ge.model.ExpedienteAltaPorOmision
and this is the coe I wrote:


Code:
objeto.getClass().getName()



The "parent" object or the object which owns the attribute is Expediente which implements ILocalizable, and themethod which tries to get the class receibes an ILocalizable. I think that is a revelant thing to have into account.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 27, 2007 1:46 pm 
Newbie

Joined: Mon Sep 24, 2007 8:11 am
Posts: 16
I believe that the object you have is a proxy. You should be able
to determine the class of the underlying object by using the following:

Code:
((HibernateProxy)object).getHibernateLazyInitializer().getPersistentClass()


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.