nhibernate-mapping Questions

1

Solved

We are using Fluent NHibernate for data object model in the company i work. A couple of days ago, we encountered an issue that Fluent NHibernate generates an extra column which does exist neither i...

3

Solved

Here's my NHibernate mapping. <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="HelloNHibernate" namespace="HelloNHibernate"> &lt...
Discriminator asked 17/12, 2010 at 7:37

4

Solved

In my application, I need to talk to multiple databases. I am handling this in NHibernate by creating one SessionFactory per database (I assume this is the correct thing to do). So I have two sets ...

1

Solved

I have a bi-directional, many-to-many association between EntityA and EntityB and I’m using an association class, EntityABLink, to model this because there are other attributes about the relationsh...
Enthusiasm asked 22/5, 2011 at 1:23

3

Solved

In hibernate, is it possible to define a mapping for a class to a set of enums? I've been able to find examples of how to define mappings of Sets and I've been able to find separate examples for ...
Signalman asked 14/7, 2009 at 15:8

1

Solved

We have POCO, something like: public class Person { public Guid PersonID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public DateTime DateOfBirth...
Mcnabb asked 29/4, 2011 at 10:2

3

Solved

I have a class in my domain model root that looks like this: namespace Domain { public class Foo { ... } } I also have another class with the same name in a different namespace: namespace Doma...
Honorine asked 20/7, 2009 at 22:19

3

Suppose I have this relationship: abstract class Base { int Id; int JoinedId; ... } class Joined { int Id; int Discriminator; ... } class Sub1 : Base { ... } class Sub2 : Base { ... } for the fo...
Adorne asked 29/4, 2010 at 19:16

1

Solved

I have an 'Interview' entity that has a one-to-one mapping with a 'FormSubmission' entity, the Interview entity is the dominant side so to speak, the mapping is: <class name="Interview"> &l...

1

Solved

I have two entities in a bi-directional one-to-many relationship: public class Storage { public IList<Box> Boxes { get; set; } } public class Box { public Storage CurrentStorage { get; se...
Bettyebettzel asked 4/5, 2010 at 8:59

1

Solved

Please help me on this problem. I have 2 identical tables, one is timetable and another is timetable_bk. the 2 tables have similar properties or fields. Now I want to map 2 tables to one entity cl...
Hyaluronidase asked 7/3, 2011 at 3:19

1

Solved

I'm new to NHibernate so have had limited exposure to mappings etc so far, and I've just hit a scenario which I need some help with. I have 2 tables: Reviews TaggedReviews I have 2 classes that ...
Piderit asked 3/3, 2011 at 11:37

3

Solved

How do I generate xml mappings files as part of my tests in MappingIntegrationTests I need to manually check if the fluent mappings correlate to the mappings in the leagcy project.

2

Solved

I'm getting an error with NHibernate when I try to perfrom a ISession.Delete on any table with a One to Many relationship. NHibernate is trying to set the foreign key to the parent table in the c...
Jabe asked 1/2, 2011 at 15:1

1

Solved

I'm working first time with FluentNHibernate, trying to map classes to SQL Express database. In general it works, but I'm unable to map Double or Decimal property types to specific scale/precision....

3

Solved

I'm using Fluent NHibernate, and auto-mapping the classes. I have a computed property in a class along the lines of public virtual DateTime? LastActionTimeStamp { get { return Actions.Count == ...
Swoosh asked 5/3, 2010 at 13:22

5

I've have just been stumped with this problem for an hour and I annoyingly found the problem eventually. THE CIRCUMSTANCES I have a table which users a string as a primary key, this table has var...
Vorticella asked 4/1, 2009 at 22:41

8

In my system, I have two entities - ShoppingCart and ShoppingCartItem. Fairly generic use-case. However, when I save my ShoppingCart, none of the items are being saved to the DB. Within my object...
Goto asked 8/2, 2009 at 1:51

2

I have the following named SQL query defined: <sql-query name="ItemSearch"> <return class="ItemSearchResult"> <return-property name="Item" column="ItemId" /> <return-proper...
Trinary asked 15/11, 2009 at 21:34

3

Solved

I have a person entity containing an Address as a value object: public Person() { WithTable("Person"); Id(x => x.Id); Component<Address>(x => x.Address, a => { a.Map(x => x....
Spotweld asked 25/3, 2009 at 16:30

1

Solved

When using NHibernate, under what circumstances would you choose to map a collection using a composite-element to give a collection of value objects, rather than creating a full-blown entity and ma...
Homozygous asked 30/11, 2010 at 13:58

1

Solved

I have a folder hierarchy represented by the following class: public class Folder { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual Folder ParentFold...
Bramante asked 23/11, 2010 at 20:11

2

Solved

i have readonly VIEWs in an existing Database and i'd like to get them with FHN. i tried mapping it the following way: public class HhstMap : ClassMap<Hhst> { public HhstMap() { Table("HH...
Agribusiness asked 1/9, 2010 at 12:54

1

So everything is working well with the basic discriminator mapping. I can interact directly with entities A and B without any problems. public class BaseType {} public class EntityA : BaseType {} ...
Trenttrento asked 12/6, 2009 at 6:2

3

Solved

I have a parent object which has a one-to-many relationship with an ISet of child objects. The child objects have a unique constraint (PageNum and ContentID - the foreign key to the parent). <s...
Pointtopoint asked 1/4, 2009 at 17:52

© 2022 - 2024 — McMap. All rights reserved.