I have an associated set of entities. And in mapping files I made them to be fetched by join. When a query is executed, the executed query and results seem allright. But when I tried to traverse the properties. Some of associated properties are being duplicated.
When I create my criteria I set the trasformer as "distinct root entity". ...
I'm trying to to setup Memcached 2nd level caching. I've followed what documentation I could find, including downloading the project from SVN and looking at how it is configured in their test project, and ended up with this in my app.config.
<configuration>
<configSections>
<section name="memcache" type="NHibernate.Caches.MemCache...
When automapping a joined subclass in fluent nhibernate, I can't figure out how to give the joined subclass a primary key.
public class Address:Entity {
public virtual string Address1 { get; set; }
public virtual string Address2 { get; set; }
public virtual string City { get; set; }
public virtual string State { get; set; }
public ...
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 Fluent API...
How can I setup NHibernate Validator with Spring.net as IoC?
I am already using Spring.net integration with NHibernate and can't get AutoRegisterListeners to work.
What I need is to setup NHV to validate entities automatically upon Update/Save instead of having to call Validate method every time and use Spring.net with ISharedEnginePr...
1.Database platform: SqlServer
2.Data Access: nHibernate 1.2
Now we need access the store procedure by nHibernate,like this:
ALTER PROCEDURE TestProc()
AS
BEGIN
Select * From User
Return 1234
END
I know I can get the User List by IQuery,
And I want to get the default return value "1234" too.
Question:
How to...
Is it possible to parse criteria from string?
...
I'm currently building a new app based on a legacy database. In the app, there are many "list" tables that have the following format:
table listLanguages
{
PrimaryId bigint;
Item varchar(30);
}
...with some sample entries like this:
PrimaryId Item
1 English
2 French
3 Spanish
...
They were used to p...
hi
i have following model:
<class name="Person" table="Person" optimistic-lock="version" >
<id name="Id" type="Int32" unsaved-value="0" >
<generator class="native" />
</id>
<!-- plus some properties here -->
</class>
<class name="Event" table="Event" optimistic-lock="version" >
<id name="Id" type="Int32" u...
From personal experience, as well as everything I've read, NHibernate's SchemaUpdate doesn't support removing columns and tables. I'd like to use SchemaUpdate to generate migration DDL, but not having the deletes is making it more difficult. How do you get around this? Are there other tools that would help to keep the focus on the dom...
i have a table stracture which lends itself to table per subclass design. my "base" table has many common fields and each one of the children also has many fields that are unique for that entity. this works very well with joined-sublass where the common fields are added to the child entities through inheritance. the base is linked to the...
I have two tables Deal and Cost. Costs can be of a number of types, eg Planned, Unplanned. Every deal can have one an only one of each type of cost. This is easy enough to map as a many-to-one on deal, reulting in an IList of Costs. But what I want is to create a costs object that has named properties for each cost. So that for a databas...
I'm exposing some CRUD methods through WCF service, for some data objects persisted in a database through NHibernate. Is it a good approach to use NHibernate classes as data contracts, or is it better to wrap them or replace them with some other data contracts? What is your approach?
...
I've found initializing my session factory is massively quicker whenever I disable the nhibernate reflection optimizer. This is great for testing purposes.
<add key="hibernate.use_reflection_optimizer" value="false" />
My question is what is the knock-on effect of doing this, and why isn't it the default setting? Everything seems to...
Hi,
using nhibernate, how would I setup a column to be an enumeration type?
e.g.
User class has UserType which is an enumeration
public enum UserType { Normal = 1, Super = 2 }
...
I'm working on a system to use a SqlServerCe with NHibernate. From my driver program, if I add the System.Data.SqlServerCe assembly as a reference, I can create and run queries against a database just fine. When trying to use NHibernate, though, I get the following exception:
A first chance exception of type 'System.IO.FileNotFoundExc...
Starting here:
public class Customer
{
public int CustomerID { get; set; }
public string CustomerName { get; set; }
public IList<Order> Orders { get; set; }
}
public class Order
{
public int OrderID { get; set; }
public int CustomerID { get; set; }
}
What would be the linq query that you write to retrieve all Orders from ...
Hi,
Using nhibernate, how can I set the transaction level to read uncommitted?
With SQL, I usually set the transaction level at teh beginning of my stored procedure or use inline (NOLOCK).
...
I want to load root entities and eager load all it's child collection and aggregate members.
Have been trying to use the SetFetchMode in FluentNHibernate, but are getting duplicates in one of the child collection since I have a depth of 3 levels. DistinctRootEntityResultTransformer unfortunately only removes the root duplications.
ret...
In the nhibernate doco is states that to use the prevalence cache use the provider class “NHibernate.Caches.Prevalence.PrevalenceCacheProvider, NHibernate.Caches.Prevalence” https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/performance.html#performance-cache
Where do I go to doanload the assembly that contains this typ...