I'm trying to upgrade a project and use the build in code mapper.
I have 2 entities:
public class Person {
public virtual int Id { get; set; }
public virtual User User { get; set; }
}
public class User {
public virtual int Id { get; set; }
…
The ModelInspector doesn't seem to provide the means to define Filter definitions . Any ideas/Workarounds?
I need to generate the following with mappings by code:
I have 3 tables (Master, Imagen, Linea) were:
Master
public virtual int Id { get; private set; }
public virtual Imagen imagen { get; set; }
Imagen
public virtual int Id { get; private set; }
public virtual Linea linea { get; set; }
Linea
public…
I have a mapping issue with the table-per-class hierarchy in Fluent/NHibernate. When retrieving the records from the database, I keep getting an error (the Wrong type exception)
Object with id: 2445763 was not of the specified subclass: ClassA…
Basically I'm getting this exception while trying to delete a collection of entities with nHibernate. Below is my code
public void DeleteAll(IList entities)
{
using(var tx = session.BeginTransaction())
{
try
…
I have a class, Order, which I persist to a database using NHibernate. There is a folder futher down in the web application that contains an object that inherits from Order, for our purposes, we can call it CustomOrder. I use CustomOrder to place…
I read and implemented Trying to using Nhibernate with Mono & SQLite - can't find System.Data.SQLite
However, as the last comment there states this seems not to work with NHibernate 3.1
The error is
HibernateException: The IDbCommand and…
I use an abstract Entity class which contains a Guid:
public abstract class Entity
{
public /*virtual*/ Guid Id { get; set; }
}
Suppose I also have a class like:
public class Post : Entity
{
public String Title { get; set; }
public…
I have a rather complex entity which will not save when a particular database table is missing a record. When the record exists the entity saves correctly. When the record does not I receive the exception:
Invalid index N for this…
The new place I started at is just starting to develop a completely new product from scratch. They are going transaction script in application services, completely dumb entities, and a hand rolled DAL with stored procedures (the argument is that…
I've got a class with a bunch of [ColumnName("foo")] NHibernate attributes.
Is there an easy way to ask NHibernate to list all of the ColumnNames for a given class?
It sounds like it should be really easy but I'm just not seeing any kind of…
I have a method by QueryOver in Nhibernate3.1
var q = SessionInstance.QueryOver().
Where(person=>person.PersonIdentity.FirstName.IsLike(firstName,MatchMode.Anywhere));
return q.List();
Now i have a runtime error by this…
I am using this query:
return from oi in NHibernateSession.Current.Query()
select new BlaViewModel
{
...
NoPublications = oi.Publications.Count(),
...
};
BlaInteraction contains an IList of publications (i.e. entities). To…
I am working in a Microsoft .NET shop where it is okay to use NHibernate or ADO.NET EF. What guidance should we be using about when you should choose one over the other?
For example, it seems like when writing a Silverlight app the EF -to-> ADO.NET…