[hibernate-dev] UserCollectionType mapping for Ceylon

Gavin King gavin.king at gmail.com
Sun Nov 22 05:37:39 EST 2015


Ah, OK, thanks for the link, Vlad, now I think I sorta maybe see why.
With XML-based mappings, the semantic "kind" of collection is explicit
(<list/> or <set/> or whatever) whereas with annotations that is
determined by looking at the property type. The UserCollectionType
doesn't actually have this information.

So then I guess I'm going to need a bit of a deeper hack to make this work.

On Sun, Nov 22, 2015 at 7:57 AM, Vlad Mihalcea <mihalcea.vlad at gmail.com> wrote:
> I think that only the Java Collection types work with the JPA @OneToMany
> associations, as it's described int his issue:
>
> https://hibernate.atlassian.net/browse/HHH-4417
>
> So, even when specifying a @CollectionType, the return type must be a
> List/Set:
>
> @OneToMany(...)
> @CollectionType( type="MyCustomListType" )
> public List getOrders()
>
> Vlad
>
> On Sun, Nov 22, 2015 at 2:57 AM, Gavin King <gavin.king at gmail.com> wrote:
>>
>> On Sun, Nov 22, 2015 at 1:56 AM, Gavin King <gavin.king at gmail.com> wrote:
>>
>> > Of course this is surely the ideal way to handle this, but bear with
>> > me for a sec because I would like to know why what I tried didn't
>> > work.
>>
>> I mean "surely *not* the ideal way".
>>
>> --
>> Gavin King
>> gavin at ceylon-lang.org
>> http://profiles.google.com/gavin.king
>> http://ceylon-lang.org
>> http://hibernate.org
>> http://seamframework.org
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
>



-- 
Gavin King
gavin at ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org


More information about the hibernate-dev mailing list