I'm learning NHibernate and I added <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> to App.config. Visual Studio reported a message:
Could not find schema information for the element 'urn:nhibernate-configuration-2.2:hibernate-configuration'.
I know this is not a problem, but if VS knew the schema, IntelliSense w...
Hi, we have one to many to one relationship which we are trying to implement in NHibernate. This is a rephrase of my colleague's question.
There is Block with a collection of GroupPartnerInterests every of which has a Company. Following test method passes with SetMaxResults(3) but fails with SetMaxResults(5). Exception is
NHiberna...
I have a many-to-many relationship between Project and Site. I am trying to retrieve a list of Sites for a project using the Criteria API. I've got this working but the query also selects all of the columns for the associated Projects, which I don't want. I wrote what I thought was an equivalent query using HQL and it only selects the Si...
Here is what I am trying:
IQueryable query = this.MyRepository.GetShippingCollection();
IList<SomeListType> myList = query.Where(x => x.Settings
.Where(y => y.SelectorID.Equals(5))
.Count() > 0)
.OrderBy(x => x.Order)
...
hello,
I'm using Nhibernate version 2.2 for mapping classes to tables in my project. following is my class file and mapping file
public abstract class BasicUser
{
public virtual int RowID { get; set; }
public virtual string DisplayName { get; set; }
public BasicUser()
{
}
}
<class name="BasicUser" table="...
I want to do something like this...
return GetSession()
.ToPagedList<Employee>(page, pageSize,
x=> x.SetFetchMode(DomainModelHelper.GetAssociationEntityNameAsPlural<Team>(), FetchMode.Eager));
But I don't know how to pass this Func<ICriteria,ICriteria> into the ISession or ICriteria.
I have a standard paging ext...
I'm creating an invoicing feature and I want to use a counter for the invoice number, but instead of writing an implementation I was wondering if it is possible to use an existing identity generator in NHibernate for this property?
...
Suppose I have a table:
ID(pk) | HOME_EMAIL | WORK_EMAIL | OTHER_EMAIL
-------------------------------------------------
and the .NET classes
class A {
int id;
List<MyEmail> emails;
}
class MyEmail {
string email;
}
I suppose there's no way to map those (multiple) columns into a single collection in NHibernate, or is ...
Hello,
I am having an issue using nHibernate and Rhino.Security. After struggling for hours to get the right config setup, I finally got the code to run without any errors. However, no entries are being saved to the database unless I call session.Flush().
Looking at various examples on the net; I should not have to call flush.
Here’s ...
Hi,
I am a beginer with visual studio 2008 (C#), mysql and NHibernate.
I have problems with mysql connector as I don't know how to add reference to it.
In my project I have:
/lib/mysql-connector-net-6.1.4-src/
(downloaded from http://dev.mysql.com/downloads/mirror.php?id=387799#mirrors)
Now I right click on my project -> addReferenc...
Hello all,
I have two tables
tblPart
(
partId,
subpartId UNIQUE NULL
)
tblSubpart
(
subpartId
)
So I can only have zero or one subPart associated with the part at the same time.
I'm trying to map this as
ClassMap<Part>
{
HasOne(x=>x.Subpart);
}
and the convention rewrites the foreign key so it uses subpartId ins...
Hello,
This might be quite common but I'm having an issue with nhibernate on iis7 my webservice works fine on visual studio 2008 default webserver but not on iis7.
I've tried moving the httpmodule config section into the webserver/module section
and I've also tried leaving the module config inside system.web/httpModules and switching th...
When I have the following bit of code in my C# Class Library, it totally breaks the library for everything else.
namespace DesktopOCA.Infastructure
{
public class NHibernateHelper
{
private static ISessionFactory _sessionFactory;
}
}
For example this is also in that project:
namespace DesktopOCA.Infastructure
{
...
Hi, Having trouble with an HQL query. If I remove the avg(..) from it it will return all of the empty weights, so the trouble is with the avg function. It seems clear in the Nhibernate docs that I can perform an aggregate function on the select item like this. Is my problem something to do with query.ToList not liking to return a list of...
I know how to find dirty properties using NHibernate, but it doesn't seem to work for collections (i.e. to find out if items have been added or removed from a collection).
Anyone know how?
...
hi, i created the following mappings with fluent nhibernate:
public class AuswahlMap : ClassMap<Auswahl>
{
public AuswahlMap()
{
Table("AUSWAHL");
Id(x => x.Id,"ID")
.GeneratedBy.Sequence("SEQ_AUSWAHL");
Map(x => x.Programm).Not.Nullable();;
Map(x => x.Variante);
Map(x => x...
Hi
I have a querry that returns a large number of rows. I want to know if there is a way to decrease query time without changing the results.
One smsblast contains multiple smsresponses and smsresponse contains multiple smsstatuses.
Variables
status = int
smsBlastId = int
var queryStatus = DetachedCriteria.For<SmsStatus>()
.Add(Re...
Hi, i have two entities one called User and another called Membership which has a one to many mapping from User to Membership. I need to add a property on my User entity called CurrentMembership which gets the latest Membership row (ordered by the property DateAdded on the Membership Entity). I'd appreciate it if someone could show me ...
This call
// this._cfg is an NHibernate Configuration instance
this._sessionFactory = this._cfg.BuildSessionFactory();
Gives me this exception at runtime (NOT at compile time).
Could not load file or assembly 'NHibernate.ByteCode.Castle' or one of its dependencies. The system cannot find the file specified.":"NHibernate.ByteCode.Castl...
Hi,
I'm trying to load nhibernate mapping for POCO classes at runtime with following lines:
var persistentClass = NHibernateHelper.Configuration.GetClassMapping( type );
var property = persistentClass.GetProperty( propertyName );
It works fine except it fails on property GroupId on a class with following mapping:
<class name="GroupP...