-->
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: @Inheritance(strategy=InheritanceType.JOINED) and .class
PostPosted: Mon Feb 23, 2009 9:49 pm 
Regular
Regular

Joined: Mon Aug 22, 2005 1:11 pm
Posts: 50
Location: Pasadena, CA
Hi Everyone,

I am trying to use the @Inheritance(strategy=InheritanceType.JOINED) annotation with this query:

@NamedQuery(name="RbacRole.getPermissionsByType",
query="select p " +
"from RbacRole as role " +
"join role.permissions as p " +
"where role.pk = :pk and p.class = :clazz")

when I execute the query I get the following exception:

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

on the class property.

When I drop the p.class = :clazz from the query it works (obviously I dont get the resluts I wanted).

I have been debugging and trying alternatives for a while now any help would be greatly appreciated.

Also, with SINGLE_TABLE it works just fine.

Thanks,
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 24, 2009 5:28 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
Can you post the relevant mapping and table structure?

_________________
Regards,
Litty Preeth


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.