[hibernate-dev] User defined generic bag
Sergey Koshcheyev
sergey.p.k at gmail.com
Thu Apr 5 09:38:42 EDT 2007
Hi,
the list you posted to is for Java Hibernate. You probably wanted to
post to the NHibernate development list. Its address is
nhibernate-development at lists.sourceforge.net.
To answer your question, yes, please submit the patch to our JIRA
(http://jira.nhibernate.org), we will then review it and decide whether
to apply it.
Thanks,
Sergey
phi wrote:
> Hi,
>
> NHibernate 1.2 always returns an PersistentGenericBag for an association
> marked as Bag. For a project we are currently working on, we needed
> support for our own List implementation.
> NHibernate already supports an attribute "collection-type" on bags, but
> for generic collections this is ignored. I patched NHibernate to take
> into account for user defined collections and would like to ask if there
> is any interest in merging this into the official NHibernate code.
>
> What I did:
> .) Modified TypeFactory.CustomCollection to accept an additional
> "System.Type[] genericArguments" parameter.
> .) Modified NHibernate.Mapping.Collection.CustomCollection to call the
> aforementioned method.
>
> So by implementing IPersistentCollection and providing a custom Type the
> extends BagType one can easily provide its own persistent list.
>
> Currently, I only did this for associations that use bag semantics but I
> think this could be enhanced pretty well.
>
> If there is any interest please drop my a line and give me directions
> where to put the code (JIRA?).
>
> Cheers,
> phi
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
More information about the hibernate-dev
mailing list