Having entered the world of NHibernate less than one year ago, I'm still developing my
"personal" best practice and architectural solutions in this area... now I'm facing a
pretty simple issue on which I'd like to have opinions or suggestions by somebody with
more expertise.
The scenario is the following: A straight parent/child relatio...
Hello,
I am currently developing an application that reads a bunch of data from a file. The usual size of the batch of objects to be inserted in the db is around 40.000 objects. So far we have used Spring.Net and NHibernate for our development and I'd like to be as consistent as possible and use the same technologies for the bulk insert...
I want a version control system and therefore all querys must add a piece of sql
In place for the current record shows.
But what place, can i add that piece of sql to all querys ?
or could i do it with events?
...
Hi, I don't know if it's just me, but I just can't seem to find the NHibernate Jet driver anywhere.
I have not yet looked into the source, but looking at the main project files or the NH Contrib files, did not give me any results.
Enough time wasted, who can show me the way?
Thanks!
...
We have a entity with a many-to-many collection mapped as a lazy loaded bag. When we load up the entity, the collection is not loaded - great. Now we want to add a new entity to that collection. As soon as we do this, the collection is loaded up.
How do we add the new entity without loading up the whole collection (the collection is lar...
Can I use pivot tables with NHibernate?
Can I write
ID id = new Transaction().GetNextID("[TableName]", "[IDColumnName]")-like codes to increment IDs with NHibernate?
...
I know that you can do this easily with HQL using the following syntax:
"select new ItemRow(item.id, item.name) from ..."
In this example, the ItemRow need not be a persistent class that has its own mapping class.
But how can we accomplish the same using ICriteria?
...
I am trying to create a table-per-hierarchy mapping using NHibernate 2.0.1.
I have a base class with properties that exist for each subclass that other classes inherit from. All of these objects are persisted to one table called Messages that contain all of the possible fields for each class. There is a SourceID which is the discriminat...
Given the following Tables and classes.... I want to know how to Map class Bs reference to A. It doesn't have a direct reference in table B, but comes from A having a reference to it. B only ever has 1 A that will have a reference to it. Can it be done? :)
table A
int id
int bID
table B
int id
class A
{
virtual int id { get;...
Hi,
How can I delete items with nhibernate without first pulling all the objects in memory?
Is this possible or do I have to use raw sql?
...
I have 3 classes:
Mail,MailHeader,User
Mail has 2 properties: User and MailHeader
MailHeader has IList of Users (MailsDeleted)
Now i want all mails of a specific user, only if the property MailHeader.MailsDeleted does not contains that user
In other words with Linq i use:
var q = from sa in candidates
wh...
I'm moving a project from SubSonic to NHibernate and am using Fluent NHibernate to perform all of our mapping. Our db schema is pretty straight forward and most of our cases appear thus far to be well illustrated by different blog posts and sample code that's available.
One thing that I'm unable to figure out however is the ability t...
Hello All
i am facing a problem.I have a 2 Model projects and ProjectChangeRequest.
one project have multiple change request.
Now on Nhibernate mapping xml file i have taken class like this
in Project
<class name="Project" table="project" lazy="false">
<id name="ProjectID" column="ProjectID">
<generator class="native" />
...
Hi,
I want to insert a record through fluent, where a column need to have the value of getdate() sql function. How to do this in a single fluent save function?
Thanks,
...
I have an object called "Customer" which will be used in the other tables as foreign keys.
The problem is that I want to know if a "Customer" can be deleted (ie, it is not being referenced in any other tables).
Is this possible with Nhibernate?
Thanks
...
I work at a company that makes the move from php to .net.
Now i am searching for good video sources to learn new techniques.
We have already a license for www.tekpub.com great site
but already have seen a lot of movies and will check other video sources too
what video sources do you have or do you know ?
...
i have a Parent class that has two child collections ChildCollectionA and ChildCollectionB.
ChildCollectionA is mapped as an association, and has its own ID:
HasMany(parent => parent.ChildCollectionA )
.KeyColumn("IDParent")
.AsBag().Cascade.AllDeleteOrphan();
and ChildCollectionB is mapped has a co...
For example, given the following code, how is it possible to make the string comparison case-insensitive?
var query = from employeeGroup in _session.Linq<EmployeeGroup>()
from employee in employeeGroup.Employee
where employee.UserName == username
select employeeGroup.Em...
Hello, I have a table with a time column in my SQL Server 2008 database.
The property of the object I'm trying to map to is a TimeSpan.
How can i tell FluentNHibernate to use the TimeAsTimeSpan NHibernate type, so that I don't have cast problems?
...
Is it possible to find out what has changed when an object has been updated in Nhibernate?
Thanks.
...