Hi Patrik,
Yes, you are right that the reference to Parent is problematic. The only
solution that I can think of is that only the parent's properties would be
persisted. Which means that if the user actually assigns a Child class into
that reference, the child properties would be lost. In addition, when the
data is retrieved from the database, a Parent would be instantiated instead
of the Child. We could have a validation warning for the DSL when the user
references a Parent to tell them that they really need to assign only Parent
classes, or they will lose data. But yeah, this case is not very pretty.
--Polly
Patrik Nordwall wrote:
>
> Ok, now I understand what you are looking for, but what about the actual
> reference to Parent?
>
> Entity Another {
> String a
> - @Parent parent
> }
>
> It is inside the mapping for Another that the component mapping is
> located. We can't have both component mappings there.
>
> /Patrik
>
>
> amphoras wrote:
>>
>> Sorry, let me try to be more specific with more detailed example:
>>
>> BasicType Parent {
>> String a
>> }
>>
>> BasicType Child extends @Parent {
>> String b
>> }
>>
>> BasicType Child2 extends @Parent {
>> String c
>> }
>>
>> I was thinking that the component mapping could be:
>>
>> <component class="com.foo.Child" lazy="false" name="child">
>> <property name="a">
>> <property name="b">
>> </component>
>>
>> <component class="com.foo.Child2" lazy="false" name="child2">
>> <property name="a">
>> <property name="c">
>> </component>
>>
>> This is not possible in Hibernate?
>>
>> Thanks,
>> Polly
>>
>>
>
--
View this message in context:
http://www.nabble.com/-Sculptor--BasicType-and-inheritance-tp19227979s17564p20138635.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer