Questions tagged [nhibernate-collections]

13 questions
8
votes
3 answers

NHibernate custom collection type

I'm having an entity object called Patient and this entity is having a property called Visits which is of type VisitsCollection. VisitsCollections is a child class of IList but it also adds some custom logic to the collection (like auto…
3
votes
1 answer

Fluent-Nibernate with wpf: Convention to use uNhAddIns...ObservableListType as default?

I am trying to use Fluent-Nibernate with wpf that require Observable collections (implement the INotifyCollectionChanged interface). At uNHAddins: Unofficial addins for NHibernate i found the …
2
votes
2 answers

Fetch child without primary key NHibernate

I am trying to get a collection of objects into a parent object through mapping. I have a parent object "ScoreCard" whose primary key is a guid (Id) and a child "Score" object whose primary key is a guid (Id). I want to select the child objects for…
Mark Dickinson
  • 6,573
  • 4
  • 29
  • 41
2
votes
1 answer

Nhibernate iesicollection contains returns false

Nhibernate forces you to use an Iesi Set, instead of the net 4 ISet interface. In the following snippet of code I check whether an iesi set contains an item: public virtual void Remove(Substance substance) { var test =…
halcwb
  • 1,480
  • 1
  • 13
  • 26
2
votes
0 answers

NHibernate: Manually handling collection of values reading using IStatelessSession

During bulk load of entities into a database, I have a scenario where an incoming entity relies on an existing entity in the database in order to compute a value. This dependency itself has a collection of value types which is used to help compute…
codekaizen
  • 26,990
  • 7
  • 84
  • 140
2
votes
2 answers

How to insert an item without loading the entire collection in NHibernate?

I have a class model that looks like this: public class TheSystem { public virtual Guid Id { get; protected set; } public virtual ICollection Users { get; protected set; } } public class User { public virtual Guid Id { get;…
Agustin Meriles
  • 4,866
  • 3
  • 29
  • 44
2
votes
1 answer

Using NHibernate Collection Filters with DDD collections

I am trying to map a domain model in NHibernate. The domain model is implemented with what I think is DDD style. The mapping works mostly but then when I try to use a collection filter on an a collection I get an exception which says: The collection…
2
votes
1 answer

NHibernate criteria on lazyload

Can anyone tell me if it's possible to add criteria to an NHibernate lazy loaded collection. For example let's say I have a department that contains employees... I get the department by id and then I lazy load the employees... however lets say…
Todd
  • 1,461
  • 2
  • 13
  • 27
1
vote
1 answer

Updating the collections of entities with NHibernate the correct way

A simple question regarding how NHibernate works: I have a parent entity that has a collection of other child entities. Those child entities have a reference to the parent entity they belong to. Now I want to implement an Add method to the parent…
karel_evzen
  • 552
  • 4
  • 16
1
vote
2 answers

NHibernate not loading child objects

I have following class and associated mappings (Fluent NHibernate): public class Category { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string Description { get; set; } public virtual…
0
votes
1 answer

Hibernate remove item from List.

guys ! How can i remove item from Parent - > Child List ? Here is my situation. Controller @RequestMapping(value = "/delete/{distributorId}/{exhibitorId}", method = RequestMethod.GET) public String deleteExhibitor(Model model,…
0
votes
2 answers

Unusual NHibernate collection/inheritance mapping

Here are my relevant classes: public class ArticleMetadata { public long ID { get; set; } public string Slug { get; set; } } public class Article : ArticleMetadata { // This is a massive CLOB, hence separate class public string…
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
0
votes
1 answer

NHibernate - Sorting Entities based on Property/Column + how to manage?

I'm writting an ASP.NET MVC e-commerce app using NHibernate and I want the end-user to be able to control the ordering of Product Categories (not just have them appear alphebetically etc.). Normally, I'd add an OrderIndex/Sort column (of type int)…