I'm trying to create a simple User object that has a Friends property that points to an IList.
Started off just trying to get an ISet to work.
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false"
assembly="MyProject.Domain" namespace="MyProject.Domain">
<class name="User" table="[User]">
...
Just started learning NHiberate. It seems rather tedious to write proper hbm.xml config files for each database table.
The question is can NHibernate read into tables and automatically retrieve relationships and needed config file as well as database mapper classes for you? It seems that the programmer still has to do a lot of ground w...
I'm interested in moving some NHibernate configurations/mappings into the code to help with some maintenance issues. Can anyone provide any advice/pros/cons/comparisons of Fluent NHibernate vs. NHibernate.Mapping.Attributes?
I have some experience with Java Hibernate annotations, which I liked, but I'm curious if the NHibernate attribu...
I'm trying to get a specific set of data while joining 4 different entities together to do so. What I've done is setup a DTO to try to get this working:
public class LatestThread
{
private readonly string comment;
private readonly DateTime posted;
private readonly string userName;
private readonly int reputation;
private readonly ...
Here is a curiousity question. I have an application that must support both flat files and the database as a place to persist data. I was thinking maybe using a .csv or tab-delimited set of files as input ...
Is it possible to use NHibernate to write to do both persistance tasks?
...
Say I have an application that used an ORM (I am thinking of nHibernate or LINQ to Entities) for data access. How do I provide my users with the ability to do reporting against the properties of my objects? All the end user report designers I know of talk directly to a database, but I don’t like having to repeat logic in reports that ...
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can do with MultiCriteria and ICriteria objects?
With MultiCriteria I can create something like this:
var crit = session.CreateMultiCriteria()
.Add(session.CreateCriteria(typeof(Entity1)).Add(Restrictions.Eq("Property1","Value"))
...
Hi
Has any one know a way to use nHibernate with database tables that coontains ESRI's st_geometry columns?
This corrently prevents us the usage with nHibernate in our applications.
Thanks
...
I'm building ASP.Net MVC aplication based on UnitOfWorkApplication and I'd like to use Castle ATM facility. At the moment I've problem with flushing the session on request end. My service class (which is called in my controller action method) looks like this:
[Transactional]
public class UserAdminService : IUserAdminService
{
[Transac...
NHibernate doesn't require too much decoration of POCOs, but having to put surrogate keys in my domain objects makes me feel a bit ill. Call me over-zealous - I'd prefer 'ideologically consistent' - but my domain objects should surely work with natural keys and not have to resort to surrogates.
I don't mind using surrogates in my databa...
Given this db schema (it was handed down to me):
I'd like suggestions on how to both model this and map it using fluent-nhibernate.
The only thing I can come up with is a very active record style of modeling (a class for each table and the obvious associations).
Ignoring the db for a second though, I think I want every facility to a...
How would you express the following Criteria query in HQL?
var idArray = new int[] { 1, 2, 3, 4, 5 };
Session.CreateCriteria(typeof(Foo))
.Add(Expression.In("Id", idArray)
.List<Foo>();
I am aware of that there is an "in" keyword in HQL, but as I understand it that keyword is for use with subqueries rather than something like...
Hello, everyone!
I've run into the problem with NHibernate proxy validation using Castle.Validator component. It's looks like validator could not fetch attributes from entity proxy's properties.
I've tried to define validation attributes using Inherited = true while Castle.Validator runner fetch em using following statement:
property....
Using HQL, you can build a query like the following which will return an array of objects for each row selected by simply using a comma delimited list in the select clause:
select mother, offspr, mate.Name
from Eg.DomesticCat as mother
inner join mother.Mate as mate
left outer join mother.Kittens as offspr
How would you do thi...
Does anyone whether it is possible to configure Fluent NHibernate to auto-map objects using 'Table with concrete class' inheritance. On looking at the auto-mappings (which I had written to file) I have a number of entities that derive from EntityBase but I would like the Id column to be on each table rather than on an EntityBase table....
I'm using the SchemaExport class in NHibernate to generate my database from my .hbm.xml files. Is there a way to set the Identity Seed on my tables to 0 rather than 1? For ref tables, I prefer to have all my initial status ids set to 0, and I don't want to have to reset this value every time I regenerate my DB while in dev. I'm using SQL...
Background:
My team is dedicated to ensuring that straight from checkout, our code compiles and unit tests run successfully. To facilitate this and test some of our NHibernate mappings, we've added a SQLite DB to our repository which is a mirror of our production SQL Server 2005 database. We're using the latest versions of: MbUnit3 (p...
Hi guys,
My code below showing 444 Identical records when it runs. but when you
run the produce hql statement below on SQL server its 444 unique
records which is the what I am expecting.
Did I miss any thing?
Mapping:
public class AccessibleDocumentsDtoMap :
ClassMap<AccessibleDocumentsDto>
{
public AccessibleDocument...
Okay, simple question.. :)
In my webportal I got users, who obviously need to log on.
I got a table with users in a MSSQL-DB:
PK - GUID - UserId
CK - nvarchar - Email
CK - nvarchar - PhoneNumber
Now, I want users to be able to log on to my site using either their phonenumber or email, so I need to somehow fetch a user using eith...
I have a User, Book and UserBooks releation table. UserBooks table like this
|UserID | BookID | Status |
1 34 Read
1 35 Unread
2 34 Read
2 70 Read
2 32 Unread
...................
My domain classes are User,Book and UserBook. in NHibernate how can I ge...