It is defined in sample-data.xml, I am running a JUnit test on the dao of
Verse to retrieve a Chapter from the Verse.



>  =============
> | OSBBaseObj           |
>  ============  |
> | id : Long                |
> | parent: OSBBaseObj| (@many-to-one)
> |                             |
>  ------------------------------
>              / \
>               |        (Verse extends OSBBaseObj and so does Chapter)
>  =================
> | Verse                              |  ( subclasses mapped  as
> @hibernate.joined-subclass 
>  ================= |  (                               
> @hibernate.joined-subclass-key table persubclass)
> | id : Long                          |
> | getChapter()->super.getParent()|
> |                                       |
>  ---------------------------------------
> 

I hope this helps....

Thank you, 
  Andrew


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#a8012801
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to