I understand why, I just don't know what to do about it.
It's because the OSBObject I wish to cast using ploymorphism is really just
the proxy and not an actual object. So I guess I just need to find out how
to tell the poxy to cast the OSBBaseObject it is proxying into a Chapter
Object.
GojiraDeMonstah wrote:
>
> How is baseObj getting instantiated?
>
> Jason
>
>
> On 12/20/06, maskkkk < [EMAIL PROTECTED]> wrote:
>>
>>
>> I have a base class (OSBBaseObject) which is extended by both Chapter and
>> Verse
>> (The mappings for the parent are defined in the OSBBaseObject)
>>
>> There is a parent-child relationship between Chapter and Verse.....
>> (many-to-one), now when I ask the Verse for the parent Chapter (see
>> bellow)
>>
>>
>> asking verse for it's chapter wrote:
>> >
>> > public Chapter getChapter()
>> > {
>> >
>> > parentChapter = (Chapter) baseObj;
>> >
>> > return parentChapter;
>> > }
>> >
>>
>> I recieve the folllowing exception:
>>
>>
>> The Error I get wrote:
>> >
>> > com.me.model.OSBBaseObject$$EnhancerByCGLIB$$a602890b
>> >
>> > java.lang.ClassCastException:
>> > com.me.model.OSBBaseObject$$EnhancerByCGLIB$$a602890b at
>> > com.me.model.Verse.getChapter(Verse.java:59) at
>> > com.me.dao.OsbBaseObjectDaoTest.testGetVerseAssociations(
>> OsbBaseObjectDaoTest.java:129)
>> > at
>> > org.springframework.test.ConditionalTestCase.runBare(
>> ConditionalTestCase.java:69)
>> >
>>
>> Thank you,
>> Andrew J. Leer
>> --
>> View this message in context:
>> http://www.nabble.com/Question-on-class-casting-tf2863809s2369.html#a8003017
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Question-on-class-casting-tf2863809s2369.html#a8012907
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]