Questions tagged [nhibernate-3]

Use this tag for Nhibernate version 3.x series specific question.

NHibernate is a mature, open source object-relational mapper (ORM) for the .NET framework. This tag refers to the 3.x series of this project.

86 questions
0
votes
1 answer

NHibernate should always write NULL instead of empty string

I use NHibernate 3 with Microsoft SQL Server Database (2005 and higher). Now, I am searching a way to tell NHibernate to write always NULL to the database instead of empty strings. What would be the best way to do this? - Or is there perhaps a…
BennoDual
  • 5,865
  • 15
  • 67
  • 153
0
votes
2 answers

Merge an existing Object which reference a new one

I load a Contact-objekt from the database. The Object Contact has a one-to-many mapping to ContactSecurity:
BennoDual
  • 5,865
  • 15
  • 67
  • 153
0
votes
1 answer

How would I use Linq-To-Nhibernate (NH3.2) to have the database return to me the record count of a query without the records themselves?

I have a bunch of queries to run, and if any of them return even a single result, I toggle a boolean variable true. If they all return no results, then it stays false. Right now I'm just picking the smallest column and .Select() ing it, and then…
Isaac Bolinger
  • 7,328
  • 11
  • 52
  • 90
0
votes
2 answers

NHibernate, map a collection where key can be two different columns

There's an entity A. In addition, there's an entity B which has two associations with A. A has a collection of B. This collection must load any B if one of associated A is the parent of loaded A. Problem is collection mapping on A must filter…
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
0
votes
1 answer

Using an attribute to override FluentNhibernate AutoMapper for manytomany

I would like to use NHibernate Automapper to map the following class: public class AdminUser: Identity, IIdentityWithRoles { public virtual IList Roles { get; set; } } Problem is that Automapper creates a manytoone relationship…
Richard
  • 21,728
  • 13
  • 62
  • 101
0
votes
2 answers

Is there a better implementation for SybaseDialect in Version 3.0 of NHibernate?

We have upgraded to NHibernate 3.0 with Fluent-NHibernate. In version 2.1.2 we where able to use the SybaseDialect for ASE 12. In version 3.0 SybaseDialect for ASE 12 is not supported. I reused the old Dialect from Nhib 2.1.2 and all is…
Razcer
  • 394
  • 4
  • 17
0
votes
1 answer

In C#, why can't I access this stream?

I got this block of code from the NHibernate 3 Cookbook (an excellent book, btw), and while I couldn't find anyting in the errata about it. I'm getting the error "Cannot access a closed stream": var settings = new XmlWriterSettings { Indent = true…
Paul
  • 35,689
  • 11
  • 93
  • 122
0
votes
1 answer

Syntax error on multi query in NHibernate 3 and MySQL

I used to be able to run the following code as a multi query in NHibernate 2.1 using MySQL var total = new LeagueInfoQuery { Count = true, User = CurrentUser }.CreateCriteria(session).FutureValue(); var leagues = new LeagueInfoQuery { User =…
Adam
  • 619
  • 1
  • 4
  • 19
0
votes
1 answer

Problem converting HQL to Linq-to-NHibernate

How to convert this NHibernate HQL(works) ... static IList PhoneList() { ISession session = OpenSession(); IQuery query = session.CreateQuery("from Phone p where p.Kontact.ContactName = :_contact_name"); …
Michael Buen
  • 38,643
  • 9
  • 94
  • 118
0
votes
1 answer

NHibernate 3.0 beta1 Bidirectional One-To-Many Cannot Add Child Object

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…
Mouhong Lin
  • 4,402
  • 4
  • 33
  • 48
0
votes
0 answers

javax.servlet.ServletException: com.acme.dao.StudentDao

I'm trying to deploy my project within different servers. Successfully, it was working as well with Tomcat7, Tomcat8, WildFly8 and WildFly10. Once, I was running it with JBoss 7.1, the following exception is displayed: 09:37:42,894 INFO …
Sofia
  • 19
  • 1
  • 7
0
votes
1 answer

upgrade to NHibernate 3.0.0.1002, Table is not mapped

Yesterday, I upgraded my NHibernate application from 1.2 to 3.0. I get the following exception c.SubContractors is not mapped [SELECT count(distinct c) FROM CallUp c, c.SubContractors sc Where sc.id = :id AND c.ChildCallUp IS NULL AND c.State > 0…
0
votes
1 answer

NServiceBus and NHibernate EventListeners running on different threads

What I am trying to achieve is my website raises a message and puts it on the bus, a service picks it up and writes to the database with auditing that automatically populates the AddedBy/UpdatedBy field of the row. I do this by using the NServiceBus…
Morgan
  • 76
  • 8
0
votes
1 answer

database hits occur or not when access foriegn key columns in struts2 tag

I have used struts2 tags for getting action class property values in jsp page.I have a table called employee.In that employee table, address is the foriegn key.I get a employee details in lazy fetcthing and load the values using list. List
Selva
  • 1,620
  • 3
  • 33
  • 63
0
votes
1 answer

NHibernate many-to-one "on the fly"

I'd like to know if the next problem can be solved in a different way in NHibernate. Let's say we've this domain: public class A { public virtual B LastAssociationWithB { get; set; } public virtual ICollection CollectionAssociationOfB…
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206