Hi,
In my hbm files I did this:
<property name="Title" column="title" type="string" length="100" not-null="true"></property>
I am assuming this will provide for faster data access because it is providing more information i.e. length.
Does fluent provide this behavior?
...
HI,
For a web application I really don't need any fancy transaction support etc.
If I just make by call to get session to do first look in the Request.ITems, if its not their then I call it and store it in the request.items collection, would that be enough really?
...
I have been working with NHibernate, LINQ to SQL, and Entity Framework for quite some time. And while I see the benefits to using an ORM to keep the development effort moving quickly, the code simple, and the object relational impedance mismatch to a minimum, I still find it very difficult to convince a die hard SQL dba of an ORM's stre...
I'm trying to localize error messages from NHibernate.Validator. From what I have read, the messages should automaticaly be localized if I set the CurrentCulture/CurrentUICultule ; wich I tried without success. I'm using S#arp Architecture with the default configuration. As I said, the only thnig I changed is the CurrentCulture/CurrentUI...
Hi,
Any opensource tools for Generating NHibernate mapping file as well as class in C#?
If any other that are helpfull in using NHibernate, Please give me tools list.
Thanks.
...
I understand that a IQueryable cannot be serialized. That means that queries can not be serialized, sent to a webservice, deserialized, queried and then sent back.
I was wondering if it is possible to convert a hibernate linq query to hql to be sent over the wire.
Is there another route I am missing?
...
Can I do nested transactions in NHibernate, and how do I implement them? I'm using SQL Server 2008, so support is definitely in the DBMS.
I find that if I try something like this:
using (var outerTX = UnitOfWork.Current.BeginTransaction())
{
using (var nestedTX = UnitOfWork.Current.BeginTransaction())
{
... do stuff
...
I have some columns in my database (MS SQL Server 2005) which use the data type XML.
Can these be mapped as XML objects in NHibernate? My app is .NET 3.5 so I have access to both XDocument and XmlDocument which I can use but I don't know whether NHibernate will support it.
If it doesn't does anyone have a good suggestion on how to supp...
I have a parent child relationship tables set up. In the UI, I show the details of parent and child details. After the user make changes in UI, I need to save it back to the db, but I am getting following error:
NHibernate.ADOException was caught
Message="could not update: [PlanningMaps.vo.PaRegAddresses#2][SQL: UPDATE PaRegAddr...
Hi,
I have a IIdConvention for my Fluent NHibernate mapping:
public class SplitIDNameConvention : IIdConvention
{
public bool Accept(IIdentityPart target)
{
return true;
}
public void Apply(IIdentityPart target)
{
if (target.GetColumnName() == null)
target.ColumnName(SplitName(target.Pro...
Hi,
Once I figure out nhibernate and fluent etc. (with your help!), will it really make my life easier? i.e. I can focus on my business logic layer?
OR, will I end up spending the same amount of time wrestling with criteria query and configuration issues hehe.
I am a 1 person dev on this project, and it has allot of DB queries so I wa...
I just upgraded to NHibernate 2.1 from 2.0 and w/o changing my schema now get the error "Column 'Reserved Word' does not belong to table ReservedWords." when trying to .OpenSession().
I can add the property
<property name="hbm2ddl.keywords">none</property>
to the hibernate.cfg.xml file which "fixes" the error. However, it would be he...
I am lazy loading the collections, and also because there are so many fields within the person table, I am writing a projection function to retrieve only certain properties. It works with properties, just not collections of other entities. I would be fine if they were loaded in as proxies and i could get them later, but right now it just...
I have an NHibernate ISQLQuery.List()
ISQLQuery sqlQuery = session.CreateSQLQuery(query);
IList tags = sqlQuery.List();
where the results in "tags" are an object[] containing 2 child objects.
[0] {object[2]} object {object[]}
[0] 1 object {int}
[1] "irregular" object {string}
[1] {object[2]} object {object[]}
[0] 2 object...
Hi all!
We are using NHibernate as our ORM framework.
We have a need to persist classes we load at run time. We do that according to metadata they come with, that holds names and types of the data they have.
In order to build the tables for them at run time, we use the SchemaExport class from the NHibernate ToolSet API.
We wanted to as...
Hi all,
We have the following Database design.
As you can see, there is non normalized between the main tables ("ACCOUNTS" and "CONTACTS") with "NOTES".
How we can get a collection of "Notes" for the 2 main tables based on this DB design within NHibernate? We don't have the option to modify the existing DB design.
ACCOUNTS (consider...
I have a Document class which has a User Property which is the User who owns the document, but also I have a User List. Users which have access to the document. I am trying to create a query which will return documents which either I own or I have access to.
IList<Document> results = UnitOfWork.CurrentSession.CreateCriteria(typeof(Doc...
Hi,
I have a database with a 6 level hierarchy and a domain model on top of that.
something like this:
Category
-SubCategory
-Container
-DataDescription | Meta data
-Data
The mapping I'm using follows the following pattern:
<class name="Category, Sample" table="Categories">
<id name="Id"...
I need to restrict a one-to-many collection by a date column with a value specified on the parent element. The 'where' attribute on set or bag looks perfect for this.
NHibernate documentation describes the 'where' attribute as being for arbitrary SQL, so am I correct in assuming that I cannot use values from the parent class here as I w...
I'm working on my first NHibernate project, so this may seem to be a simple question.
The below is simplified from my real scenario to convey the specific question.
Lets say I have a Customer entity
public class Customer
{
prop virtual int ID { get; set; }
prop virtual string Name { get; set; }
prop virtual Region Region {...