Other options are: - Write a wrapper class for each external type that manually converts arrays to NHibernate persistent collections on demand - there may be issues keeping NHibernate and external collections in sync.
- skip NHibernate collections and load child collections manually via NHibernate queries. So an object returned from Session.load would have empty collections and you neeed to manually perform an extra step to hydrate them yourself. You could use an interceptor to manually hydrate these collections. Just remember if you're using array collections, the NHibernate session will not be able to track changes to the collection so you'll need to manage this yourself. On Dec 18, 4:10 am, Al Su <[email protected]> wrote: > Hi all, > > As per subject: > - we have 3rd party library that we can't change; > - this library uses arrays for children collections (it can be arrays > of system types(System.Uri) or library's custom types (2-3 levels > deep) - all public); > - NO ConventionalModelMapper - we want explicitly map all that we need > (to much to exclude); > - we don't want anything from these library but data to persist; > - DB from scratch. > > What will be the best practice solution in this case? > > public class MyType : Entity > { > public virtual TheirType theirtype { get; set; } > ........ > > } > > I have no problem to map simple properties from theirtype, but how can > I map (array) collections here? > > Thank you, > Alex. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
