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: how to use instanceof in hibernate?
PostPosted: Tue Jul 12, 2005 3:17 pm 
Newbie

Joined: Thu Jul 07, 2005 2:14 pm
Posts: 6
this bit of code is not working for me...

LENGTH {
public String toString() {return "Length";};
String eval(TypeSegregatedEntity e) {
Geometry g = e.getGeometry();
if (g instanceof SimpleGeometry) {
try {
return Double.toString(((SimpleGeometry) g).getLength()) + "\t";
}
catch (Exception ex) {
ex.printStackTrace();
}
}
return "\t";
}


does anyone know how to use instanceof in hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 12, 2005 3:58 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
Use Hibernate.getClass(g), this will unwrap the Geometry instance, which may be proxied.


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.