Hi,
I´m using Nhibernate 2.1.2.4000 GA with Nhibernate.Linq 1.0 and latest version of FluentNhibernate downloaded from master on github.
Im doing some tests and whenever I try to delete a entity retrieved by a linq query i´m getting this error:
No persister for: NHibernate.Linq.Query`1[[Employees.Core.Entities.Employee, Employees.Core...
Hello, I'm trying to return all entities where a given property is not empty.
The problem is IsNotEmpty() only applies to collections. Below is the general approach I've taken so far, it obviously doesn't work.
ICriteria lvCriteria = NHibernateHelper.GetCurrentSession()
.CreateCriteria(typeof(Funct...
I would like to do the following, all in a single atomic transaction:
Read an object through ActiveRecord
Save a new object through ActiveRecord
Update another table via NHibernate
Also, if by the time I finish the transaction, the value of the object I've read in step 1 has changed, I would like the transaction to fail.
I've never ...
whats the difference in the method .Get(object id) and .Load(object id) ? The documentation pretty much reads the same. Also, if it matters, in what cases should I use one over the other?
...
I am not shore why IQuerable limits me when I try to search database for data containing string from an array.
objectFactory.Resolve<IUserDao>().Query.
Where(t =>
(spltedInput.Any(val=> t.LastName.Contains(val)) || spltedInput.Any(val=> t.Name.Contains(val)))
&& t.MasterCompany.I...
Hi All
I am having some probs with my fluent mappings. I have an entity with a child collection of entities i.e Event and EventItems for example.
If I set my cascade mapping of the collection to AllDeleteOrphan I get the following error when saving a new entity to the DB:
NHibernate.HibernateException : A collection with cascade="all-...
In a project I am working on we are developing Save-As functionality for a windows desktop application. This should allow the user to save his work (in a project) to a different location (just SaveAs ;).
Our project file contains a sqlite db with our domain objects and the persistency is done using NHibernate. Now our SaveAs logic look...
I've tried to do that.
HasManyToMany<YechidotDoarInGroup>(x => x.Col_yig)
.Table("PigToYig")
.ChildKeyColumn("YIG_GROUP_RECID")
.ParentKeyColumn("PIG_GROUP_RECID");
but I've got
ORA-00942: table or view does not
exist
I am trying to establish HasManyToMany conn...
Hello..
I don't do much Java coding so I am not too familiar with the NetBeans IDE. I am trying to create a reverse engineering file based on a SQL Server connection that is set up in my hibernate.cfg.xml.
The reverse engineering wizard does not show any tables given the configuration file. I do not receive any error however. I believ...
I have NHibernate hooked up in my asp.net mvc app.
Everything works fine, if I DON'T dispose the ISession. I have read however that you should dispose, but when I do, I get random "Session is closed" exceptions.
I am injecting the ISession into my other objects with Windsor.
Here is my current NHModule:
public class NHibernateHttpMod...
I am still new to Hibernate and am attempting to use it for a web site I have inherited. Unfortunately that means sometimes the db schemas don't always make sense.
With that said, I am trying to build the following HQL query using the Criteria API
from TableB b where b.id = :id and b.TableAProperty.UserId = :userId
The above HQL sta...
My model is like this:
Flavor
public IList<Mention> Mentions
Mention
public IList<Flavor> Flavors
Therefore, a many-to-many between Flavor and Mention.
I need to create a query that returns me the flavors mentioned and the amount of times it was mentioned.
Today, I can get the query terms ordered by the number of flavors mentio...
Hi.
We use NHibernate for ORM, and at the initialization phase of our program we need to load many instances of some class T from the DB.
In our application, the following code, which extracts all these instances, takes forever:
public IList<T> GetAllWithoutTransaction()
{
using (ISession session = GetSession())
{
ILis...
I need to select first (let's say) 10000 rows in database and return them. There may be more clients that do this operation at one time. I came up with this query:
update v set v.batch_Id = :batchId
from tblRedir v
inner join (
select top 10000 id
from tblRedir
where batch_Id is null
...
I recently changes my NHibernate implementation from Version 2.1.0 to 2.1.2. For lazy loading I used the LinFu implementation using : NHibernate.ByteCode.Linfu.
Since I changed to the newest version I got the following error:
[SecurityException: That assembly does not allow partially trusted callers.]
NHibernate.ByteCode.LinFu.Proxy...
I recently upgraded my client access v5.4 to the latest v5.9. However, now, when I make a call to flush() from NHibernate's session object, the output shows the proper update query but it blows up on me. After the call to flush--even though I'm in Visual Studio--the operating system asks me which debugger I would like to use. I've select...
How to configure Fluent NHibernate to output queries to Trace or Debug instead of Console?
I'm using MsSqlConfiguration.MsSql2008.ShowSql() but it has no parameters and I can't find anything on Google.
...
I am trying to create a Unidirectional one-to-one relationship using NHibernate.
Example: An Order is given by a Customer.
Customer{ID, Name, Address}
OrderN{ID, Customer, OrderDate}
Here, OrderN.Customer-field is intended to store Customer.ID as an FK. And this field doesn't have any unique constraint.
(The OrderN-table is given su...
While doing some research into mapping one-to-one relationships I've come across some statements that have made me question some of my database design decisions.
Basically I have some entities similar to the following:
Person, Contact, Parent
Both a contact and a parent are people.
A person may be a contact, parent, both, or neither.
...
I'm trying to use nhibernate with a legacy database that has 'evolved' over the past decade or so. As you can imagine, it has a lot of crud in it, specifically, some obsolete columns. To make things worse, a lot of these obsolete columns have 'NOT-NULL' constraints, so I can't just ignore them when trying to insert records into these res...