Hi, All
I have two entities:
public class A : EntityWithTypedId
{
Guid UniqueIdentifier;
IList<B> Children;
}
public class B: EntityWithTypedId
{
A Parent;.....
}
I want to make the reference using the Guid column not the primary key
Id (so I will have in the B table UniqueIdentifier not A_id).
I can't make it to work for ...
I'm a fluent nhibernate newbie and I'm struggling mapping a hierarchy of polymorhophic objects. I've produced the following Model that recreates the essence of what I'm doing in my real application.
I have a ProductList and several specialised type of products;
public class MyProductList
{
public virtual int Id { get; set; }
pu...
Hi,
I was often directed to this blog site when I was researching on NHibernate and a lot of times I got my answers. I have a question today. I appreciate any assistance.
What I am facing now is this: a simple mapping table in our database has foreign key references to three tables. The three referenced tables are: State, Organization...
I have a bunch of domain entities that can be keyword tagged (a Tag is also an entity.)
I want to do a normal many-to-many (Tag -> TagReview <- Review) table relationship
but I don't want to have to create a new concrete relationship on both the Entity and Tag every single time I add a new entity.
I was hoping to do a generic based Ta...
Possible Duplicate:
adding an nHibernate mapping at run time?
All of the NHibernate examples I've see that use hbm files have the hbm.xml file set as an embedded resource with "do not copy" chosen in the file properties. This means that if a database column name were to change in production, the app would have to be recompiled...
I'm testing how difficult it is to use NHibernate with a domain that is completely unaware of it and isn't bent to accodomate any limitations.
On many examples I found on the web the domain being mapped is yet another example of an anemic domain, where objects don't go far from being simple data holders. Sure, this makes the mapping sim...
I have two tables (tbArea, tbPost) that relate to the following classes.
class Area
{
int ID
string Name
...
}
class Post
{
int ID
string Title
Area Area
...
}
These two classes map up with Fluent Nhibernate. Below is the post mapping.
public class PostMapping : ClassMap<Post>
{
public PostMapping()
...
I have an object called MyItem that references children in the same item. How do I set up an nhibernate mapping file to store this item.
public class MyItem
{
public virtual string Id {get;set;}
public virtual string Name {get;set;}
public virtual string Version {get;set;}
public virtual IList<MyItem> Children {g...
A recent release of Fluent Nhibernate (1.1) now supports stored procedures. I was wondering if anyone out there has found any good blog articles on how to do this!
I am not asking about using classic hbm mappings instead which these questions previously asked:
http://stackoverflow.com/questions/296732/does-fluent-nhibernate-support-map...
(Felt quite helpless in formulating an appropriate title...)
Is it possible to define a mapping for a class such that some properties are fetched from another table using a join query?
In my C# app I display a list of "A" objects, along with some properties of their associated "B" objects and properties of B's associated "C" objects:
...
Hi,
I've been banging my head against a brick wall for nearly two days on this so any help would be great.
The scenario I've got is basically this.
I have an object called Campaign which I'm creating from scratch in a web client. The Campaign has a reference to another object, Portal. The Portal has been pulled from the database thr...
I am using Fluent NHibernate to map the following classes:
public abstract class DomainObject
{
public virtual int Id { get; protected internal set; }
}
public class Attribute
{
public virtual string Name { get; set; }
}
public class AttributeRule
{
public virtual Attribute Attribute { get; set; }
public virtual Statio...
I have the following database structure:
Event table
Id - Guid (PK)
Name - NVarChar
Description - NVarChar
SpecialEvent table
Id - Guid (PK)
StartDate - DateTime
EndDate - DateTime
I have an abstract Event class, and a SpecialEvent class that inherits from it. Eventually I will have a RecurringEvent class which will inherit from the E...
Hello everybody,
I am having a Problem with my nhibernate-mapping and I can't find a solution by searching on stackoverflow/google/documentation.
The database I am using has (amongst others) two tables. One is unit with the following fields:
id
enduring_id
starts
ends
damage_enduring_id
[...]
The other one is damage, which has the ...
Hey guys, I am having some real issues with mapping using fluent nhibernate. I realise there are MANY posts both on this site and many others focusing on specific types of mapping but as of yet, I have not found a solution that solves my issue.
Here is what I have:
namespace MyProject.Models.Entites
{
public class Project
{
...
Hi All,
I've been trying for ages to find an example (because I can't get it to work myself) of the correct mapping for a one-to-many relationship on an abstract class of a table-per-subclass implementation, in fluent nHibernate.
An example below: I'm looking to map the list of Fines on the Debt abstract base class to the Fine class.
...
Hello everyone,
I'm working on a C# .NET project in which I am mapping my classes to the tables in my database with NHibernate. I need to use NHibernate.Mapping.Attributes and transactions to be configured by Spring.
The fact is that Spring 1.3.0 provides a sample project called "Spring.Data.NHibernate.Northwind" that almost provides a...
I have an abstract class, and subclasses of this, and I want to map this to my database using NHibernate. I'm using Fluent, and read on the wiki how to do the mapping. But when I add the mapping of the subclass an NHibernate.DuplicateMappingException is thrown when it is mapping. Why?
Here are my (simplified) classes:
public abstract...
In my application I have a bool property named DisplayIndicator. In the database (DB2) it's correspondence is DISPL_IND column of type smallint.
The correspondence is the following:
[DisplayINdicator=True, DISPL_IND=1] and
[DisplayINdicator=False, DISPL_IND=0]
Is it possible to map using nhibernate fluence the bool property to smallint?...
Hi,
I'm trying to map two domain entities to the same table. We're doing a smart entity for our domain model, so we have the concept of an Editable Address and a readonly Address. I have both mapped using Classmaps, and everything seems to go fine until we try to export the schema using the SchemaExport class from NHibernate. It erro...