nhibernate

nhibernate domain objects and grid binding

i have two tables like: CREATE TABLE [dbo].[Entry]( [Id] [int] IDENTITY(1,1) NOT NULL, [TitleId] [int] NOT NULL, [Text] [nvarchar] (max) NULL ) CREATE TABLE [dbo].[Title]( [Id] [int] IDENTITY(1,1) NOT NULL, [Lang] [nvarchar] (50) NULL ) there tables are connected by Title.Id and Entry.TitleId columns. i want to show some dat...

Generate database schema from NHibernate mapping

Is it possible to generate the database schema from the Nhibernate mappings DLL? My requirements is for MySQL. If so, how do I do that? Are there tools/scripts for this? Open source/freeware tools? Additionally, can I use these tools to insert/update datasets to the database? ...

how to create a fresh database before tests run ?

how to create a fresh database (everytime) before tests run from a schema file ? ...

Filters in Doctrine

nHibernate has a great feature called filters, so i can create criterias globally for my applications. I'm starting a project in PHP and i need to use an ORM, i'd like to know if Doctrine has a similar feature to manage query conditions. thanks ...

Simple query to update a user entity for my DAO in nhibernate

Hi, can someone post how I should write code to perform an update on my User entity? I want to create a User DAO that will perform all queries related to this entity. ...

How do add NOLOCK with nHibernate?

Hi, How do you add NOLOCK when using nhibernate? (criteria query) ...

Finding what database column an entity's property is mapped to.

I was wondering if anyone knew how to find what column an entity's property is mapped to using NHibernate and only having the IEntityPersister interface available. ...

Is there any info on NHibernate code coverage (by its test suite)?

Just curious. Tried to google this, but found nothing. I remember earlier there was some information related to this, but now I can't find anything at all. So... I'd appreciate any help ;) ...

Complicated NHibernate component mapping

EDIT: I simplified the problem to leave only what really bothers me. Hello all, I am trying to make the following mapping. In my database, I have a table called "ReportRowValue" containg the following columns: RowNumber ColumnNumber StringValue LongValue DateValue Value In my code I want to get a more usable structure by...

Nhibernate - Generate schema without forign key

For our test fixtures we use NHibernate to generate a database schema. We have a slight strange case in which an entity references a another entity but we don't wish to have a foreign key constraint (it should be possible to delete the referenced entity so a foreign key cannot be used). Is it possible to specify that the generated schem...

Save objects retrieved from web services

Hi I am totaly new to SubSonic, and have never used any other tool like it. I am not sure if SubSonic would be the right tool, or if there are any other tool that could help. Maybe someone can clarify things for me. :) The scenario is this: I have a c# application that fetches data from a set of secured web services, secured through W...

Help me test a one-to-many realtionship with NHibernate and NUnit.

I have a class, Task, and it has a property TaskLibrary which is dll it will load and run some code from. So, any task has one library, but any library can have many tasks. My problem is that my test for making sure the task's Library property is not null is failing (so it could just be my test). My classes are effectively this: public ...

NHibernate: mapping a dictionary of lists

Hi, My class has a field of type Dictionary<string, List<string>>. What's the best way to map it with NHibernate? I'd better leave it as a field, don't want to expose it. Thanks a lot! ulu ...

When working with NHibernate, should you create your database tables before your map files?

Simple question, hopefully with a simple answer. I was under the impression I should create my tables and then use the map files to map my POCO classes to the database objects. After following some tutorials, I have this code in my Test SetUp: new SchemaExport(_configuration).Execute(false, true, false, false); Which, obviously, crea...

Use a Criteria on top of another Criteria

I have a question on criteria: How can i use a Criteria (or similar) that filters and/or do whatever with another criteria? Something like: select clients.* from (select * from clients) as clients The real problem is something else, but achieving this behaviour would be terrific... (btw, both java and .net are welcome to help) ...

IFNULL in NHibernate

Right now I have something like this in NHibernate: Expression.Like(property, value, MatchMode.Anywhere) and that generates SQL like: property LIKE '%value%' which is fine for that case. In another case, I want the SQL: IFNULL(property LIKE '%value%', 0) but I don't see any example in the manual that refers to IFNULL, nor can I...

nHibernate Linq Projection

I am using the version 1.0 release of Linq for nHibernate. When I run the following linq statements I receive the error not a single-length projection: Surname I can find very few references to this on the web and looking into the source it says it should never occur! ClientID is a Int type and Surname is a string. When I comment out a...

Converting from SQL to HQL fail

Trying to go from here this SQL: SELECT DISTINCT iss.ID FROM Issue AS iss INNER JOIN Message ON Message.IssueID = iss.ID INNER JOIN Clinician ON Clinician.UserID = Message.FromUserID INNER JOIN OrgUnit ON OrgUnit.ID = Clinician.OrgUnitID WHERE OrgUnit.ID = [id-number] To here in HQL: select distinc...

Strings are appended with special characters when returned from the database

Hi, I am using NHibernate to query an Oracle 8i database. The problem is that all the strings in the returned objects are postfixed with special characters. For e.g. CUSTOMER,ONE������� The nhibernate field type is AnsiString and the Oracle datatype is CHAR(20) and the Character set is CHAR_CS. I am totally new with Oracle so i don't...

NHibernate Mapping a property to the existence of a row

I have the following entity and Fluent NHibernate mapping: public class Advertiser { public virtual int AdvertiserId { get; set; } public virtual string AdvertiserName { get; set; } public virtual bool IsPriorityEntity { get; set; } } public class AdvertiserMapping : ClassMap<Advertiser> { public AdvertiserMapping() ...