Good day!
Please, can you help me to translate such a mysql query into nhibernate
SELECT sales_id, service_id,dayofyear(dt), max(dt) FROM clients.statistics group by sales_id, service_id,dayofyear(dt);
I am trying to create a type of recorded data transaction that I can replay on a different database.
For example I am capturing an order into a system, when I save that I want to be able to "export" a sql script that I can run on another database to create the same order.
I am using NHibernate and I am trying to catch the sql query string for the…
I have a 'Customer' table with 'FirstName' and 'LastName' columns. I have to execute a search on the 'Customer' table after 'FirstName', 'LastName' and 'FirstName + LastName' depending on a TextBox text. What's the besty way/query to implement this using NHibernate or SQL query?
Is there a way in NHibernate to start with an unproxied model
var m = new Model() { ID = 1 };
m.Name = "test";
//Model also has .LastName and .Age
Now save this model only updating Name without first selecting the model from the session?
Hi, I'm developing an application that reads data from a SQL server database (migrated from a legacy DB) with nHibernate and s#arp architecture through ADO.NET Data services. I'm trying to map a many-to-many relationship. I have a Error class:
public class Error
{
public virtual int ERROR_ID { get; set; }
public virtual string ERROR_CODE {…
Fluent.NET est un framework Open Source proposant une surcouche des API .NET sous la forme d'interfaces fluentes. Le proc?d? s'appuie sur les extensions de m?thodes et facilite la lecture de code : "English speakers read from left to right, not from the outside in. So why are we writing code that way? Fluent.NET aims to correct this problem by…
First up. Its actually really easy. I’m not very religious about my DB tech, I don’t really care, I just want something that works. So I’m happy to consider all options if they provide an advantage, and recently I was considering jumping from NHibernate to EF 4.0. However before ditching NHibernate and jumping to EF 4.0 I thought…
I was recently trying and failing to set up NHibernate (v1.2) in an ASP.NET project. The aim was to execute a stored procedure and return the results, but it took several iterations for me to end up with a working solution. In this post I am simply trying to put the required code in one place, in the hope that the snippets may be useful in…
I have legacy DB that store dates that means no-date as 9999-21-31,
The column Till_Date is of type DateTime not-null="true".
in the application i want to build persisted class that represent no-date as null,
So i used nullable DateTime in C# //public DateTime? TillDate {get; set; }
I created IUserType that knows to convert the entity…
Hi There
I am working on a mvc app using nhibernate as the orm (ncommon framework)
I have parent/child entities: Product, Vendor & ProductVendors and a one to many relationship between them with Product having a ProductVendors collection Product.ProductVendors.
I currently am retrieving a Product object and eager loading the…
Suppose, I have saved some permissions in the database by using this code:
RoleRepository roleRep = new RoleRepository();
Role role = new Role();
role.PermissionItems = Permission.GetList();
roleRep .SaveOrUpdate(role);
Now, I need this code to delete the PermissionItem(s) associated with a Role when role.PermissionItems == null.…
We're about to embark on some ASP.NET MVC development and have been using our own entity framework for years. However we need to support more than our entity framework is capable of and so I'd like to get some opinions about using MVC with a more robust framework. We have narrowed down or choices to either NHibernate (with the…
Hi
I am trying to get Windsor to give me an instance ISession for each request, which should be injected into all the repositories
Here is my container setup
container.AddFacility<FactorySupportFacility>().Register(
…
Note: Now that I've typed this out, I have to apologize for the super long question, however, I think all the code and information presented here is in some way relevant.
Okay, I'm getting odd "Session Is Closed" errors, at…
Hi,
I'm just starting out with NHibernate and I'm having trouble with running more complex queries.
I have entities with a list of tags attached. The user will provide two lists of tags, include and exclude.
I need to find…
Hi,
I am trying to put together an index using terms, which I specify as a comma separated list. I want to replicate the display in Luke as seen here:
http://ayende.com/Blog/archive/2009/05/03/nhibernate-search-again.aspx
…
I have the following domain set up for persistence with NHibernate:
I am using the PaperConfiguration as the root aggregate.
I want to select all PaperConfiguration objects for a given Tier and AcademicYearConfiguration.…
I have a class setup that looks something like this:
public abstract class Parent
{
public virtual bool IsDeleted { get; set; }
}
public class Child : Parent
{
}
public class Other
{
public virtual…
I have NHibernate hooked up in my asp.net mvc app.
Everything works fine, if I DON'T dispose the ISession. I have read however that you should dispose, but when I do, I get random "Session is closed"…
I'm getting the error "Illegal acces to loading collection" when i'm trying to get a list of variants belonging to a certain product. The NHibernate mapping is as below;
<list name="Variants"…
For quite some time , I was reading about the optimistic concurrency in NHibernate. If what i understood was correct then the below sample should hold good.
Consider two transactions T1 and T2.
…
I'm using a stored procedure to handle search on my site, it includes full text searching, relevance and paging. I also wanted it to return the total number of results that would have been…