Hello. I Have one-to-one relation in my NHibernate mapping:
<many-to-one name="PersonProfile" not-null="true"
class="PersonProfile" column="profile" cascade="all" lazy="proxy"/>
...
<one-to-one name="Owner" class="Person" property-ref="PersonProfile"
constrained="true" lazy="proxy"/>
PersonProfile class have batch-size attrib...
I'm exploring the offerings of an ORM (focusing on NHibernate, considering all options) and am convinced that using one could be a great benefit for some of our projects--however I'm having a hard time picturing just how it would play in our system.
My understanding is that an ORM is ideally used to glue together a database and business...
I am using WCF for my project and i need to transit some entities through it.
The thing is that some of them have lists inside, with an enormeous ammount of items, and so forth, i cannot pass it through WCF, given its size.
How can I, through code, not load a given property from the database, but load all the rest?
...
Hi,
I have a two classes that I'm trying to map:
public class Data
{
public virtual int Id {get;set;}
public virtual ValueObject Primary {get;set;}
public virtual IList<ValueObject> Secondary {get;set;}
public virtual void SetPrimary(ValueObject valueObject)
{
valueObject.Data = this;
Primary = data...
I have a proxy for a lazy entity which has been created in the session by loading a child entity. A subsequent fetch on the parent entity only returns the NH proxy. I need the actual instance to check the type (the entity has joined subclasses). I must be missing something, but I can't find a way to do this. Session.Refresh(proxy) does n...
Hi everybody,
I am using an oracle database, so defined dialect as Oracle9Dialect.
But it throws error :
"Could not load type NHibernate.Dialect.
Oracle9Dialect. Possible
cause: no assembly name specified."
I just change the dialect as MsSql2000Dialect without changing
driver_class, it works. But, in this case i cannot use oracle spes...
I'm using the NHibernate criteria API to load some entities from my database. My domain consists of an abstract class, Animal, which the concrete Cat class inherits from. Another concrete class, Tiger, inherits from Cat.
I need to load all Cats from the database, so I'm doing the following-
ICriteria criteria = session.CreateCriteria(t...
I'm checking out Linq for NHibernate 2.1 to use in an ASP.NET MVC application and I am trying to figure out session management. As a first experiment I am trying to modify the SportsStore application from Pro ASP.NET MVC Framework. This sample app uses Linq to Sql so I thought it would be a good exercise. I have NHibernate 2.1 accessing ...
nHibernate is giving the error : Custom type does not implement UserCollectionType: myApp.Domain.OrderLineCollection.
BindingList implements IList, so why is nHibernate trying to use UserCollectionType instead of IList?
public class OrderHeader
{
public virtual int OrderHeaderId { get; set; }
public virtual string OrderNumber...
We have recently upgraded our windows forms C# project from NHibernate 2.0 to 2.1. We updated our app.config to include the "proxyfactory.factory_class" to point to the chosen proxy ("NHibernate.ByteCode.Castle" in our case). After the upgrade the program builds and runs as expected, with no issues. Our problem is when attempting to open...
I am trying to query against an IList<string> property on one of my domain classes using NHibernate. Here is a simple example to demonstrate:
public class Demo
{
public Demo()
{
this.Tags = new List<string>();
}
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual IL...
I need to get NHibernate 2.1 to talk to an oracle database. I am being required to use the Orace 10g client. I get the following error when trying to build my session factory:
Unable to cast object of type
'Oracle.DataAccess.Client.OracleConnection'
to type
'System.Data.Common.DbConnection'.
I don't recall getting this error ...
I use LINQ a lot in general, especially LINQ-to-Objects, hence I'm rather fluent in LINQ.
I was considering to use LINQ-to-NHibernate as the query language for my NHibernate project. When I wrote some tests, I noticed that LINQ-to-NHibernate doesn't make the same query as ICriteria. Since I'd prefer to use LINQ, I'd like to ask if anyon...
Is it possible to retrieve the value of a global filter?
e.g.
ISession.GetEnabledFilter("MyFilter").GetParameter("MyParam");
...
I want to use some of predefined lookups without roundrips to Database in NHibernate.
Basically I would like to have code like this:
public class Countries
{
static Countries() {
Australia = new Country
{
Id = 14,
Description = "Australia"
}
}
public static Country Austrlia { get; protected set...
Does Linq-to-NHibernate support retrieving data from multiple entities in a single query?
e.g.
Dim query = From f In context.Session.Linq(Of Floor)() _
Select f.Id, f.Name, f.Building.Id, f.Building.Name
Dim results = query.ToList()
Where Building is the parent entity of Floor
...
I'm wondering how to persist a property that depends on both regular persisted properties (e.g. string, int) as well as some custom transforms of their own.
For instance suppose I have
class A
{
public int Id {get; set;}
public string SomeString {get; set;}
public object SpecialProperty {get; set;}
}
suppose that persisti...
Hi, this was posted on hibernate.org forums and nhusers list without much luck, so I thought I would try here.
Put simply, suppose I have a class:
class A
{
public virtual object SomeValue { get; set; }
}
the type of SomeValue is basically in the set of .NET IConvertible types (primitives like bool, byte, char, int16, double, floa...
hi. i use nhibernate. i got a Customer and Customer got a IList.. now when i add a new Customer and CustomerUser i do like this.
var customer = new Customer {
Name = txtCustomerName.Text,
OrgNumber = txtOrgNumber.Text
};
var customerUser = new CustomerUser {
Email = txtUserMail.Text,
Password = password.Sha1()
};
custom...
I have adonet.batch_size set to 10, but when I do a save on an object graph, it will save the object and all it's children in a separate database call.
I am able to see this using the NHProf tool.
-- statement #1
INSERT INTO Preferences
-- statement #2
INSERT INTO PreferencesToWidgets
-- statement #3
INSERT INTO PreferencesToWidgets
--...