Questions tagged [nhibernate]
The nhibernate tag has no summary.
32 questions
2
votes
2
answers
253
views
Best practice for ORM design (re: cascading delete from single entity)
If I have a very common shared table (ie. names) with a primary key (ie. name_id) included in many other tables as foreign keys, do I need my common table (names) to have a mapping reference to every ...
2
votes
3
answers
526
views
Should the domain layer be dependent on NHibernate?
Please see the code below:
public interface IUnitOfWorkWrite <TSession> : IDisposable
{
TSession Session { get; }
void Commit();
void Rollback();
...
8
votes
3
answers
8k
views
What is the "best" way to approach validation from the perspective of a DDD purist?
I recently asked this question.
I am trying to decide where to put the validation in a DDD app. I believe it should be done at every layer.
I am now concentrating on the Domain model. I was ...
1
vote
1
answer
3k
views
One Session Factory for the lifetime of an application or one Session Factory per Unit of Work?
Please see the code below, which creates a Session Factory per Unit Of Work:
public int Update(IdentityRoleView role)
{
var role2 = AutoMapper.Mapper.Map<IdentityRole>(role);
...
2
votes
1
answer
123
views
How to make associations security proof
When designing an application I usually stumble upon a problem I've never quite managed to handle properly.
Suppose you have Products and Orders. Usually in my data-access layer I have repositories ...
16
votes
5
answers
9k
views
If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?
I've recently read a lot of arguments against using the repository pattern with powerful ORM's like Entity Framework as it incorporates repository-like functionality, along with Unit of Work ...
3
votes
2
answers
1k
views
Should I use nhibernate for a one row settings table
I am using nhibernate in a quite big project.
The system has a settings table which has 10 columns and one row, there is always a row and it should not be deleted only modified.
Concurrency can be a ...
1
vote
0
answers
108
views
Can NHibernate's ISession be considered as implementation of unit of work pattern?
I am debating this with myself. Does NHibernate's ISession offer a proper and correct unit of work if used without a transaction? In absence of a transaction, every SQL command would be wrapped by the ...
3
votes
3
answers
269
views
Abstracton layer to control services access to denormalized db entity
Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, ...
0
votes
2
answers
374
views
Definition of the NHibernate Mapping by Code / EF Code First pattern?
Sub-questions:
Does this pattern have a formal definition?
Who invented it?
Is it considered a DSL?
The reason why I am asking is because I would like to better assess its applicability to non-classic-...
3
votes
0
answers
741
views
How to implement DDD in a distributed application with NHibernate?
I have an ASP.NET MVC web site working in this way:
(In the controller)
var user = _applicationService.GetUserById(1);
user.ChangeEmail("[email protected]");
user.ChangeAddress("my new street", ...
1
vote
2
answers
1k
views
Unit test DAO code using SQL Lite when the application database is Oracle
We have an application with Oracle backend. The DAO layer is written in C# and uses nHibernet to perform the data operations.
To unit test our DAO code, we use SQL Lite which creates the database ...
3
votes
2
answers
2k
views
NHibernate and complex domain model against a legacy database
I'm trying to refactor (actually, rewrite) an application which currently uses only stored procedures to access the database (hundreds of SPs). My goal is to use Nhibernate and follow a good design as ...
4
votes
1
answer
413
views
What specific features of NHibernate cause it to be recommended for legacy database systems?
So, I've been evaluating Entity Framework and NHibernate (I'm not looking for an EF vs. NH battle here, though!).
One thing that I see come up very often is that NHibernate is recommended for "legacy"...
1
vote
2
answers
622
views
What is the origin/meaning of the name 'NHibernate'?
Been poking around the web because I was curious as to why they called it that but haven't found anything yet. Anyone know?
(I checked the FAQ and it wasn't clear if questions on history/origins were ...