nhibernate-mapping Questions

3

Solved

I have a data access class with an Enum called Salutation: public enum Salutation { Unknown = 0, Dame = 1, etc Mr = 5, etc } I am peristing the class with NHibernate, and up until this m...

3

Solved

using fluent nhibernate, and automappings (nhibernate creates my db schema), how can i get nhibernate to create a nvarchar(max) column in the database based on the following class public class Vir...
Impartible asked 20/8, 2010 at 15:19

2

I am getting an error - 'Class com.fasterxml.jackson.datatype.joda.deser.DateTimeDeserializer has no default (no arg) constructor' while I am trying to call restangular for post request. When I cal...
Semela asked 18/7, 2016 at 9:42

1

Solved

I faced the below error fluentNhibernate in .net 6 project but the same code is working in framework 4.8. Error: could not create the driver from nhibernate.driver.sqlclientdriver, nhibernate, vers...
Stairwell asked 30/12, 2021 at 17:32

6

Solved

One-to-one relations within nhibernate can be lazyloaded either "false" or "proxy". I was wondering if anyone knows a way to do a lazy one-to-one mapping. I worked out a hack to achieve the same r...
Schaub asked 23/12, 2008 at 14:42

2

Solved

I have a mapping in NHibernate like this: <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping namespace="News.BusinessEntity" assembly="News.BusinessEntity" xmlns="urn:nhibernate-...
Pipes asked 26/7, 2011 at 9:13

4

Solved

I'm looking for a FluentNH (Fluent NHibernate) convention or configuration that ignores all properties that have no setter: It would still map these: public class foo{ public virtual int bar {ge...
Emmyemmye asked 23/8, 2010 at 11:19

2

I have tried using the Reveal property in Fluent but I can't get it to compile with a collection. I want one of my collections in an entity to be protected and not accessible anywhere except in the...

2

Solved

I have a class called ReportRequest as: public class ReportRequest { Int32 templateId; List<Int32> entityIds; public virtual Int32? Id { get; set; } public virtual Int32 TemplateId...
Monomial asked 28/10, 2009 at 16:57

4

Solved

I need to optimize a query that is being produced by a save (insert query) on a domain entity. I've configured NHibernate using Fluent NHibernate. Here's the query generated by NHibernate during t...

3

Solved

I'm having an entity object called Patient and this entity is having a property called Visits which is of type VisitsCollection. VisitsCollections is a child class of IList<Visit> but it als...

2

Solved

I have the following class: public class Product { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual Decimal PricePerMonth { get; set; } public virtu...
Helton asked 4/1, 2010 at 18:34

2

Solved

I've worked with both 2 types of container between IWindsorContainer and IUnityContainer in different project for service and Interface binding. However I am not pretty sure what are the difference...

4

Solved

I'm struggling to find the best way to model 1 : 0,1 relationships ("may have one" or "has at most one"). I believe this is called Z cardinality. For example, suppose I have two classes Widget and...
Allaround asked 5/2, 2010 at 16:52

2

Solved

I'm having a problem with NHibernate querying the database way too many times. I just realized it likely relates to the n+1 problem but I can't figure out how to change my mappings to solve the pro...
Kenlee asked 1/9, 2016 at 5:1

1

I receive a list of NHibernate entities that were retrieved by code that I cannot modify. I want to select a property from a child entity for each item in the list, but it is generating a new selec...
Petitioner asked 11/7, 2016 at 1:0

2

Solved

Here are the relevant pieces. This is a parent object: public class Article { public virtual IList<ArticleRevision> Revisions { get; set; } } <list name="Revisions" cascade="all" invers...
Herald asked 11/5, 2011 at 16:52

5

Solved

I'm getting this exception (Full exception at the bottom): NHibernate.PropertyValueException was unhandled by user code Message="not-null property references a null or transient valueClearwave.Mo...

1

Solved

How can I make NHibernate autogenerate unique IDs for a table? The IDs can be any long values, as long as each one is only used once. My current mapping looks like this: <id name="Id"> &lt...
Directorate asked 11/12, 2015 at 9:9

3

Solved

I have a child table containing an id to the parent. This is a one to one mapping, but the child table might be missing values. I'm having problems mapping this without getting an error though... I...
Quigley asked 3/9, 2010 at 10:7

2

I'm struggling with a NHibernate related problem where I could use some input. Introduction: I have a legacy database where the relational concepts have not really been applied. In the database ...
Amalia asked 11/8, 2015 at 6:51

2

Solved

I am new to NHibernate and C#, so please be gentle! I have the following two NHibernate entities: Employee { private long _id; private String _name; private String _empNumber; private IList&l...
Normannormand asked 1/5, 2015 at 10:20

4

Solved

I'm newbie in NHibernate. I'm trying using this ORM with SQLite. I have the following: Product.cs namespace Stock.Models.Classes { class Product { public virtual string Name {get; set;} publ...
Fruitarian asked 8/1, 2013 at 12:25

3

Solved

I've seen some examples in which decimal is used in NHibernate projects for mapping to whole number columns in Oracle. Right now I'm using int and long in my program. What are the advantages of d...
Raleighraley asked 31/3, 2011 at 15:6

3

Solved

I am coming from an Entity Framework and LLBL background for my ORM tools. I have been asked to build a new system based on NHibernate. I have never done so, so I am coming at it with fresh eyes. ...

© 2022 - 2024 — McMap. All rights reserved.