Hi all,
We're trying to decide if it's worth using entity framework 4 on a project. To that end, I think a good place to start would be by comparing it to nhibernate, which is mature and proven by years of use to have all the features people need for enterprisey apps, and find out what features nHibernate has that EF4 is missing out on....
Hi guys,
In short, the problem is that, when add child object to the collection property of the parent object without explicit setting the parent property of the child object, the insert will fail. Let's take a example:
NOTE: I'm using NHibernate 3.0 beta1.
Example: Product-Category Senario:
(1) Database Schema:
Category (Id, Name)...
I have this mapping file:
'class name="WebTools.Data.Common.IHObjekt, WebTools.Data" table="IHObjekt"'
....
'property name="TYPBEZEICH" type="string"'
...
'many-to-one name="standort" column="STANDORT_ID" fetch="join"'
And I would like to use a 'Projections.ProjectionList()' to reduce the number of returned columns from the...
Hi,
What is IDetachedQuery and its difference with DetachedCriteria? How and when IDetachedQuery is used?
UPDATE:
I'm using NHibernate 2.1.2.4000
...
I have an entity with several Many to One relationships and I've found I can eagerly fetch them in one query like such:
public Accommodation GetEager(int id)
{
IList<Accommodation> query = NHibernateSession.CurrentFor(NHibernateSession.DefaultFactoryKey)
.CreateQuery(@"
select a from Accommodation as a
left j...
Please, help! I new to nHibernate and I stuck on problem - I can't create new persisted object via NHibernate (2)
In this code:
foreach (var item in items)
{
if (item.price > 0)
{
if (_itemsForBuy.FirstOrDefault(i => item.itemid == i.itemId) == null)
{
var ifb = new ItemForBuy()
{
id = 0,
item = item,
count = 1...
Hi guys,
Is there some way to queue the "Add" operation in NHibernate, just like Linq to SQL and Entity Framework does?
I want to add an entity to the repository, but I don't want to save it to the database immediately, because the business logic is complex. I want to submit all changes when I call ITransaction.Commit(), just like Ent...
Hi,
I have an entity that I want to reuse across projects. The entity needs to know its parent which is generally mapped with something like this:
<many-to-one name="Parent" class="ParentClass, parent.assembly" column="parentuid" not-found="exception" not-null="true" lazy="proxy" cascade="none"/>
The same entity can be used by many ...
i'm beginer of NHibernet. i search many web site for simple NHibernate program,that program have some error,,so need help for NHibernate setp by step processing.....please any one help me....
...
Using the following classes..
public class Trait
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
}
public class Sheet
{
public virtual int Id { get; set; }
public virtual IDictionary<Trait, int> Influences { get; set; }
}
I have tried to map them using Fluent nHibernate, as such.
public ...
I'm developing a web application and I would like caching to persist across web requests.
I am aware that the first level cache is per-session only. I have second-level caching enabled and this is working for queries.
However, the second-level cache does not seem to work for "getting" entities... therefore most of the DB work the appli...
Hi, i've been using Nhibernate with LINQ a fair bit now and i have a few issues. Say i have the following entities:
public class User
{
public virtual int UserID { get; set; }
public virtual bool IsActive { get; set; }
public virtual bool SomeField { get { return 0; } }
public virtual DateTime DateRegistered { get; set;...
I'm trying to add an implementation of IPostLoadEventListener to my NHibernate configuration using FluentNHibernate. I can do so as illustrated here:
http://stackoverflow.com/questions/1433638/how-to-add-event-listener-via-fluent-nhibernate
However, creating a new array to replace the old one completely discards any existing event list...
Hi all,
I'm, building an n-tier system using nHibernate i de back-end, and which is cummunicating using REST/json with the front-end.
When i send an object to the back-end, I only send the data like :
myAddress: [
{ guid: "1",
street: "MyHomeStreet",
houseNumber: "34",
city: "6" }
]
So, I only send the referenced city entity's...
According to REST philosophy, a PUT operation should (taken from Wikipedia):
PUT http://example.com/resources/142
Update the address member of the collection, or if it doesn't exist, create it.
NHibernate seems to have two ways of dealing with entity IDs:
Auto-generate an ID, regardless of what value the user set.
Use the ID as...
I need to execute a SQL stored procedure every time before I query my ObjectContext. What I want to achieve is setting the CONTEXT_INFO to a value which will be later on used with most of my queries.
Has anyone done that? Is that possible?
[EDIT]
Currently I'm achieving this by opening the connection and executing the stored procedure...
I want to use NHibernate in my project, and it comes with log4net by default.
In my opinion, it would be a wiser choice to go for Nlog as it still gets updates, log4net on the other hand is completely outdated.
Is there a best choice because I don't really believe in using outdated technologies in my application. On the other hand, it'...
select count(*) from employee where not exists (select * from salary where employee_id = employee.id)
can some one please wirte in Criterai Query
...
Hi there,
I'm analyzing a project in asp.net with mvc and would like to use NHibernate as ORM.
All over the net I find books, tutorials, quick start guides to work with SQL and Linq-to-Sql but allmost never for Oracle.
What is the best setup?
In my project we have a rather small database in Oracle and I prefer to have model that is cr...
I would like to use the Iesi.Collections HashedSet class for entity collections in NHibernate. The functionality I want is that duplicate entities cannot be added. I would like entities to be considered duplicate if they share the Id (i.e. primary key) field, or, if they have Id == 0 (i.e. unsaved), then certain key properties are compar...