I query my Database using NHibernate. Now I need to restrict the data being selected using a Predicate. So far I found out (Google driven development at its best) that something like this is possible using Expressions and NHibernate.Linq.
Here's…
I have a DB with the following tables:
Roles: [Id, Name, ...]
Permissions: [Id, Name, ...]
MetaDataDefinitions: [Id, Name, ...]
RolePermissions: [Id, RoleId, PermissionId, MetaDataDefinitionId]
POCO classes are:
class Role {
public Role() {
…
I'm having trouble saving an entity into an SQL Server 2005 database. I'm using NHibernate 2.0.0.3002 for my persistence layer. The mapping is typical, with an integer ID, as follows
…
I have a many to many relationship:
Product has many Categories and Category has Many Products.
Say I have
Shopping Category
Food Category
Product A - Shopping Category, Food Category
Product B - Shopping Category
Now I delete Shopping…
I am working with brownfield database that uses strings as primary keys.
Using Fluent NHibernate with Sqlite (in-memory provider for unit testing) and SQL Server 2005.
I have the following entity:
public class Entity
{
public virtual DateTime…
Hi all NHibernate gurus !
Given these two classes :
public class User {
long Id;
string Name;
}
public class Project {
long Id;
User Owner;
IList Managers;
...
}
I would like to do a query using QueryOver (not using…
I'm trying to implement a service that will run jobs based on Quartz.Net. The jobs may have dependencies like IRepository<> and the repository implementation will have a NHibernate ISession injected into it. (Quartz will be hosted in a Windows…
I recently stumpled upon the problem to dynamically create Linq expressions during runtime. Most examples I found deal with the rather simple task of just comparing one property of a given database entity with a single parameter. Like so:
…
I am working with Linq-To-NHibernate. I need to use some properties that is not mapped to columns.
For example
Repository
.Find()
.Select(p => new PersonModel() { Id = p.Id, FullName= p.FullName,Position = p.Position });
The position…
I've configured nHibernate to output its SQL statements to the Visual Studio output window using the following configuration code:
var configuration = Fluently.Configure(cfg)
.Database(
…
I'm currently learning Linq to Sql and Im very surprised by the performance of selecting data. I'm retreving joined data from few tables. I select about 40k of rows. Mapping this data to objects using ADO times about 35s, using NHbiernate times…
I've following mapping for two tables having a Many-to-Many relationship between them. How do I delete an entry from the mapping table, which is 'ProjectUser' in my case?
public ProjectMap()
{
Id(x => x.Id);
Map(x => x.ProjectName);
…
I am using the old linq provider for nHibernate and waiting patiently
for the new one to come out. I am sure it will save me much pain.
Anyway, I have a problem with the code below as it generates a "Object
reference not set to an instance of an…
I'm trying to make NHibernate generate my schema/SQL 2008, and using the mapping below it keeps wanting to create an nvarchar(255) column instead of text...any ideas?