I want to use DDD in a new project and model my classes first, then generate the database schema based on the class library. My plan is to do this with the NHibernate hbm2ddl tool SchemaExport.
The problem is that I can't get the SchemaExport to work because of a weird catch-22 problem it puts me in. The SchemaExport requires a Configur...
I have tried various approaches to mapping the following structure, but I finally admit that after a day of not getting very far, I need some help.
So the question is, how would you guys go about mapping something like this. The schema is not fixed at this point.
public abstract class BaseObject
{
public virtual int Id { get; set; ...
Can we update Id fields in NHibernate like the following?
MyClass myObj = MyClass.Retrieve(1);
myObj.Id = 999;
myObj.Name = "name name";
myObj.Value = 1000;
MyClass.Update(myObj);
...
I'm trying to set up NHibernate in Mono, to store objects in SQLite.
I've copied/pasted the example configuration file. I only have the following two lines of code:
var config = new Configuration();
config.Configure();
Which result in the following ungrammatical validation exception:
System.InvalidOperationException :
Unexpecte...
i have used fluent nhibernate for 3projects so i know the basics but i havent used the hasManyToMany yet. i have found documents that show me how to mapp it so i guess that is ok. my question about that is what sould use the hasManyToMany in its mapping and what should i put in the other? let me know if im unclear in my explaining and if...
What is the difference between lazy="true" and lazy="proxy" in nhibernate?
...
I have a simple example of a blog: a Post table, a Tag table and a Post_Tag_MM lookup table linking the two tables.
I use this hql query in order to fetch all posts, that DONT have some tags:
var result = session
.CreateQuery(@"
select p from Post p
...
I'm trying to figure out the best way to handle loading objects with different graphs (related entities) depending on the context their being used.
For example Here's a sample of my domain objects:
public class Puzzle
{
public Id{ get; private set; }
public string TopicUrl { get; set; }
public string EndTopic { get; set; }
...
I'm working on a project that requires me to load tables based on table names stored in another table. More tables will be added to the DB (and by someone else), so creating NHibernate mapping files for each table isn't an option.
Does anyone know if it is possible to load tables dynamically using NHibernate?
Edit: I should add t...
Currently I have database with the following associations:
One Client to Many Intakes
One Intake to Many CaseManagements
One CaseManagement to Many Interventions
Client, Intake, CaseManagement are single classes per table
Intervention is a class-hierarchy-per-table.
Currently, if I do something like this:
var client = new Client()...
I have a library that was written using nHibernate and I am trying to connect it to a WPF application. Looking for a way to integrate the validation without tightly coupling the code... Any suggestions
...
I downloaded latest version of NHibernate “2.1.0.2002”.
It built fine, but when I run my unit tests, I keep getting error :-
System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest defin...
I'm getting a little tired of all the UI demos of auto completion in ASP.Net. I believe the UI portion of autocompletion has been solved multiple times over again.
My question is how do you best handle the queries hitting your webservices? I'm currently implementing an autocompletion service for a musician database. The database is fai...
Example:
Client object has a collection of Action objects which records a history of actions performed against the client. Action is abstract and has several subclasses e.g. SystemAction, CorrespondenceAction etc.
I have a client search screen which has many optional search criteria, so using the criteria API is the obvious choice. ...
I am using NHibernate and calling a stored procedure via a named query:
<sql-query name="SearchStuff" read-only="true" cacheable="true">
<return class="ResultEntity" />
EXEC [SearchStuff] ?, ?, ? </sql-query>
Many of the stored procedure parameters are deliberately nullable - this cannot be changed.
The C#:
IQuery listQuery =...
Hi there,
I have xml files containing data that I wish to insert into my database using Nhibernate. I can write some Linq that will process my data and map it to my nhibernate objects but I was wondering if there was some way of doing this without the need to write the translator from XML to Nhibernate myself.
Am not sure if something e...
I have a reference application that I use to work through DDD issues, and my current focus is on persistence. An alternate title for this post could have been DDD / TDD persistence tools and methods, but that is a (very) broad topic and I do have a specific question on SQL Server.
I'm going to outline my current tool set in this paragra...
I am having a heck of a time trying to figure out my session management woes in NHibernate. I am assuming that a lot of my trouble is due to lack of knowledge of IoC and AOP concepts; at least that is what I am thinking by where Fabio Maulo keeps directing me.
Anyways, my problem is that I have a win forms application that is making "ge...
When I define the NHibernate entity/mapping to use Guid as identity column I receive an exception. The Guid column is generated as a varchar(40), but the content seem to be binary.
Is there a solution to this? For now I'm just using plain ol' int, but it would be nice to know for future projects! :)
...
For some reason the Nhibernate is chocking out when I try to access the session. It is throwing the following exception:
No CurrentSessionContext configured (set the property current_session_context_class)!
Please note I am not using XML to setup the configuration!
I am opening the session in my test:
[SetUp]
public void ...