I'm playing around with Sharp Architecture Lite, which emphasizes convention over configuration, and trying to understand how the NHibernate ConventionModelMapper works. Specifically, I can't tell the difference between the IsRootEntity & IsEntity…
I am working with a brownfield database and am trying to configure a subclass map which joins to its subclasses with a column other than that of the specified id. The login table has a primary key column login_sk which I'd like to use as its id. It…
Hi StackOverflow users,
I ran into this problem
I have three QueryOvers and each of them returns a list of candidate ids that I then use to bring those candidates.
For this I wrote the following code.
private IQueryOver
I'm building a C# WPF application using the MVVM pattern. I have repository classes that use NHibernate to persist my domain model.
My model consists of a larger tree structure (Recipes containing Operations containing Phases). Operations and phases…
I hit a situation today where a field in our legacy db that should never be empty... was empty.
I am using NHibernate 3.2 against this database and the queries that are affected are written in QueryOver.
My current query is this
return Session
…
I'm working on a CacheProvider for Redis. I've stumbled upon something quite curious about the pre-built NHibernate Cache Providers.
When in a distributed environment, I'd expect each web server to share the same NHibernate cache. Therefore, if one…
I've been struggling with this for a while, and can't seem to figure it out...
I've got a BlogPost class, which has a collection of Comments, and each of the comments has a DatePosted field.
What I need to do is query for a BlogPost and return it…
I'm using now Entity framework- but it's a problem "shared" between all ORM's and even IEnumerable.
Let's say I have a method in MVC looks like this:
[HttpPost]
public ActionResult Foo(FooModel model)
{
var context = new Context(); -- The EF…
I'm using the following code in an ASP.NET page to create a record, then count the records to make sure I haven't exceeded a set limit and rollback the transaction if I have.
using (var session = NhibernateHelper.OpenSession())
using (var…
I am trying to do a like comparison based on an outside parameter (passed by a search form) that determines type of comparison ("%string" or "string%" or "%string%")
I was thinking in the following direction:
query = query.Where(
…
I have a problem with a SQL query results in NHibernate 3.1.0.4000 (I'm using MS SQL Server 2005 database). I have two tables: Adverts and Investments, which are mapped to entities: Advert and Investment. Adverts are connected with Investments via…
I am using NHibernate with a SQL query to populate some entity objects.
I have an Item object which references a User object (to indicate the owner of the Item)
class Item
{
public User User;
}
My SQL query is (it's actually more complicated, which…
Is it possible to use LocalDB databases with NHibernate? If yes, what should be installed/configured?
Currently when trying to use connection string like Data Source=(LocalDb)\v11.0;Initial Catalog=tst1;Integrated Security=SSPI when creating…
Does anyone know of any way to overcome NotSupportedException? I have a method against a User:
public virtual bool IsAbove(User otherUser)
{
return HeirarchyString.StartsWith(otherUser.HeirarchyString);
}
And I want to…
I am a newbie with NHibernate, so please bear with me.
Let's imagine, i have a property for CreatedDate, and i wanted it to be filled with the sql server datetime value.
The possible solution that i found out is, to mark this property as…