Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Nhibernate cache and how the querying works

Let us assume I have table product with column Id,Name ,price. Using Nhibernate if I get Product with Id 1 as below and update price var product = session.Get<Product>(1); product.price = ...
NAGASREE 's user avatar
0 votes
1 answer
36 views

C# Nhibernate | PL/SQL Oracle - different length of string when it contains diacritical marks

I have example string, which I'm trying to put as value in VARCHAR(255) column (in oracle database) using nhibernate ISession object. abssssssssssssssssssssssssd ...
DawDiag's user avatar
  • 13
0 votes
0 answers
28 views

Manipulation of queries with NHibernate and FluentNHibernate of older versions on .Net Framework 4.5.1

I am working on an old project and we need to make some adjustments. It is on .Net 4.5.1 with NHibernate 3.1.0.4000 and FluentNHibernate 1.2.0.0. I haven't considered the option to update them yet ...
Φωτεινή Βέρδου's user avatar
0 votes
0 answers
26 views

How to extract parts of a linq fluent nHibernate selection into a function?

This is my fluent nHibernate select: var sprachfoerderkraefteContent = (from sprachfoerderkraft in Session.MainDBSession.Query<MITARBEITER>() from ...
Gener4tor's user avatar
  • 388
0 votes
1 answer
29 views

FluentNHibernate: CamelCaseField vs ReadOnlyPropertyThroughCamelCaseField

Given the following class: public class User { private IList<ActivationToken> _activationTokens; public virtual IReadOnlyList<ActivationToken> ActivationTokens => _activationTokens....
speednick's user avatar
0 votes
1 answer
24 views

NHibernate Partition By with Over Clause

Does NHibernate support SQL partition by with over using RANK() or ROW_Number() Please advise how to write NHibernate query over for below . SELECT this_.ORDERNUMBER ,ROW_NUMBER () OVER ( ...
Manjusha's user avatar
0 votes
1 answer
42 views

What is the Use of Inverse() in Nhibernate

In my project i see the below code where is Inverse() is used I want to understand what is use of it and parent child relationship works with and without inverse public CityMap() { Table("...
Abxxx0's user avatar
  • 3
0 votes
0 answers
28 views

Nhibernate get max items

I have a plan table which is having the following structure id plan_id plan_number 1 1 1 2 1 2 3 1 3 4 2 1 5 2 2 for each plan I would like ...
user14636877's user avatar
0 votes
0 answers
20 views

Fluent NHibernate multiple tables with shared data models

I work with a database with several practically identical tables. For illustrative purposes they look like this: CREATE TABLE MyTable ( Id INT NOT NULL, Title VARCHAR(255) NOT NULL ) INSERT ...
TheHvidsten's user avatar
  • 4,384
0 votes
1 answer
248 views

GlobalType mapping in Fluent Nhibernate and npgsql

I'm migrating my project to use newest Npgsql library (v 8.0.2). I used this construction to map C# type to the Postgres type: var nameTranslator = new NpgsqlSnakeCaseNameTranslator();; ...
xurc's user avatar
  • 99
0 votes
0 answers
12 views

Exception when using Sqlite with Nhibernate for integration tests

I get Exception when using Sqlite with Nhibernate for integration tests: TypeLoadException":generic arguments[0], "system.nullable {system.datetimeOffset} on System.Nullable[T] violates the ...
Ankit Jasuja's user avatar
0 votes
1 answer
78 views

NHibernate: Entities Mapped Incorrectly Despite Correct Configuration

I'm facing an issue with NHibernate where entities are being mapped incorrectly despite what seems to be the correct configuration. Here's a summary of the scenario: I have a class ProductPrices with ...
Angelo Fuller's user avatar
0 votes
0 answers
27 views

How to get all objects with parameters of other tables in NHibernate?

I have two classes: public class Catalog { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual IList<Article>? Articles { get; set; } ...
Danny Ocean's user avatar
1 vote
0 answers
153 views

Writing NetTopologysuite Point geometry to PostgreSQL with fluent nhibernate fails due to custom type mapping

I just copied some outdated code to a new project with latest libs and writing of NTS geometries to PostgreSQL no longer works. Anyone has a hint for me? DB setup is done as follows: var db = ...
Martin Horvath's user avatar
0 votes
0 answers
31 views

How to reference both entities when having only one column in one table in Fluent Nhibernate?

So, I have two classes defined as such: public class Booking { public virtual ID {get;set;} public virtual Room BookedRoom {get;set;} //.... } public class Room { public virtual ...
Brodeeno's user avatar
0 votes
0 answers
52 views

Installing FluentNHibernate creates conflicts between different versions of "NHibernate"

This are the warnings I get: Found conflicts between different versions of "NHibernate" that could not be resolved. There was a conflict between "NHibernate, Version=5.3.0.0, Culture=...
Gener4tor's user avatar
  • 388
0 votes
1 answer
31 views

How to join multible Tables using linq with fluent nHibernate (left join)?

This are my domain classes: public class File { public virtual long LFD { get; set; } public virtual long AK_KEY_PE_WERBER { get; set; } public virtual long AK_KEY_PE_RECHT { get; set; } ...
Gener4tor's user avatar
  • 388
-1 votes
1 answer
52 views

Select items from a group by where count is larger than 1

The following sample query: select * from ( select m.name, count(m.id) c from mytable m group by m.name) a where a.c > 1 How do I build that using NHibernate QueryOver? It is easy ...
Peter Larsen 'CPH''s user avatar
0 votes
1 answer
59 views

NHibernate OrchardCMS and Long Id: object references an unsaved transient instance

I'm using OrchardCMS (1.10.x) as a Web Application. OrchardCMS use integer field as primary key on database (ContentItemRecord.Id). However, soon, the web application will need more than pass the max ...
NatsuDragonEye's user avatar
0 votes
1 answer
133 views

Fluent nhibernate BuildSessionFactory with Microsoft.Data.Sqlite is not Working

Trying to establish session factory on Microsoft.Data.Sqlite with fluent nhibernate. All references are added and are available in the bin folder on runtime. var sessionFactory = Fluently.Configure() ...
Priyanka Chandrabose's user avatar
0 votes
1 answer
50 views

Map a HasMany relationship without any key column whatsoever - Where() only

Conceptually I want to map a collection like this: HasMany(x => x.Children).Where("some_column_name='foo'"); The default mode of HasMany() requires me to provide a KeyColumn which should ...
Nick Eby's user avatar
0 votes
1 answer
71 views

Select data from a sub-select

This is what I want to accomplish using NHibernate QueryOver: SELECT TOP 10 * from (SELECT aColumn, min(WorkingDay) as d FROM aTable GROUP BY aColumn) ...
Peter Larsen 'CPH''s user avatar
1 vote
0 answers
89 views

How to use fluent nHibernate from an ArcGIS Pro 3.1 AddIn with C#?

I am programming a ArcGIS Pro 3.1 AddIn with C#. I try to initialize a fluent nHibernate connection: public ISessionFactory CreateSessionFactory() { Action<MappingConfiguration> mappings = m ...
Gener4tor's user avatar
  • 388
0 votes
0 answers
23 views

Fluent Nhibernate HasMany Duplicate Insert Problem

I Have Duplicate Insert Problem. When i try insert duplicate rows public class CostRegister : Entity<int> { public virtual IList<CostDocumentRegister.CostDocumentRegister> ...
Rasim Kaptan's user avatar
0 votes
0 answers
152 views

NHibernate Queries with Common Table Expression

I have an SQL Server query of the kind: WITH MostRecentToday AS ( SELECT *, ROW_NUMBER() OVER(PARTITION BY ItemGuid ORDER BY Version DESC) AS rn FROM Items WHERE Cast(Timestamp As date) = '...
Mike's user avatar
  • 899
0 votes
1 answer
135 views

Why does fluent nHibernate throw a NotSupportedException?

I use this query to search for a name in a SQL Server database via fluent nHibernate: var content = (from person in DBSession.Query<Person>() where (...
Gener4tor's user avatar
  • 388
0 votes
1 answer
369 views

Error while adding second level cache in Nhibernate configuration .Net Core 6

I have migrated my legacy Asp.Net project to a Asp.Net Core 6 solution. I try to build the NHibernate session factory by adding a second level cache provider ('CoreDistributedCacheProvider') but I am ...
tsiro's user avatar
  • 2,383
0 votes
1 answer
95 views

nhibernate transaction sometimes does not insert all records

After doing more research and listening to advice here I have been able to get closer to figuring out my issue. The NHibernate issue that I am having deals with a transaction and it has only been ...
user1591668's user avatar
  • 2,873
0 votes
1 answer
18 views

Why does Fluent nHibernate not set Id of child object when using SaveOrUpdate?

Why does Fluent nHibernate not set Id of child object when using SaveOrUpdate? I got the following fluent nHibernate domain and mapping classes (reduced for this question): public class Error { ...
Gener4tor's user avatar
  • 388
0 votes
1 answer
220 views

nHIbernate query with conditional join

I'm trying to get an nHibernate query to work without success. Here is my data structure: public class Permission { public Guid Id {get; set;} public string Name {get; set;} } public class ...
mitti2000's user avatar
0 votes
1 answer
23 views

FluentNHibernate exception when there are slash in the default value

I have been trying to map a string value using FulentNHibernate like below. Map(x => x.FilePath).Length(500).Not.Nullable().Default(@"C:\Program Files\server\data\conf\groups.txt"); But ...
Kavin404's user avatar
  • 1,029
0 votes
1 answer
26 views

Nhibernate map one column to two tables based on type

Is it possible to create nhiberante mapping for this sql structure (so base on CompanyType it links CompanyId to either CompanyTypeA or CompanyTypeB): ---- UserTable ---- Id (int) CompanyId (int) ...
user2818842's user avatar
0 votes
0 answers
515 views

Version number in Entity Framework Core equivalent to NHibernate

In NHibernate when we are mapping an entity, we map version number like this: Version(x => x.VersionNumber); As a result, VersionNumber gets added with default value of 1 and with each update of ...
rank0001's user avatar
0 votes
1 answer
185 views

NHibernate and SQL Server Temporal Tables

I am using Fluent NHibernate to query data stored in a SQL Server temporal table. All I really want to do is to run a query such as SELECT * FROM [MyDB].[dbo].[MyTable] for system_time as of '2022-12-...
Mike's user avatar
  • 899
0 votes
1 answer
128 views

How to map an enum as a foreign key in (Fluent) NHibernate?

How do I map an enum property as an integer foreign key in (Fluent) NHibernate? The enum property serves as a type field which is an integer in the database, but it also needs to be a foreign key to a ...
Herman Schoenfeld's user avatar
0 votes
0 answers
104 views

Why I dont get an exception when fluent nHibernate fails to create table?

I use fluent nHibernate to connect to a SQL Server database. So this is my domain class: public class Option { public virtual long Id { get; set; } public virtual string User { get; set; } ...
Gener4tor's user avatar
  • 388
0 votes
0 answers
34 views

Fluently with NHibernate: reference other row in table by "parent_id" but return actual entity, not the id?

I was wondering if this is possible with Fluently in NHibernate. The scenario: I have an entity looking something like this: public class PairedEntity { public virtual int Id { get; set; } ...
Piotr Aahahhkja's user avatar
0 votes
0 answers
127 views

NHibernate session.saveOrUpdate takes a long time

I have the below mapping of data, everything is mapped correctly for each mode public DataMap() { Id(x => x.Id).GeneratedBy.Identity().UnsavedValue(0); Map(x => x.Name).Not....
am.cosomo's user avatar
0 votes
0 answers
255 views

Fluent NHibernate mapping to view and table

I have a situation where I would like to write data to both an Entity table and an Entity view. We are migrating the source of truth for some data in a table from a single multi-tenant database to ...
John O's user avatar
  • 942
0 votes
1 answer
127 views

fluent NHibernate not saving the foreign key in HasMany. The column remains null

I am struggling to have the Foreign Keys in my mappings. My Model looks like this: public class Accountant: Entity { public virtual string Name { get; set; } public virtual IList&...
McMaribo's user avatar
0 votes
1 answer
49 views

Can I use NHibernate.Cfg.Configuration in Fluent-NHibernate when building a session factory?

I want to use the NHibernate configuration for FluentNhibernate when building a session. This how I am constructing my factory session: lock (_factorylock) { if (_factory ==...
user avatar
0 votes
1 answer
83 views

FluentNHibernate.Cfg.FluentConfigurationException NHiberNate

I get an error like this when writing unit test My product class is like this. I added virtual. My map is like this. SqlServerHelper like this. I am using vs code 2022. I'm developing with Net 6.0 ...
Gökay Açıkgöz's user avatar
1 vote
1 answer
142 views

Slow query in MS-SQL + Fluent NHibernate

TL;DR: A query using wildcards/like takes four times longer to complete in Fluent NHibernate than executing exactly the same query using Management Studio. This only happens in MS-SQL, while Postgres ...
Dan Byström's user avatar
  • 9,209
0 votes
1 answer
161 views

FluentNhibernate - Handle query that refers to a null reference

I tested NHibernate in .net Core and in .Net framework and it seems that requesting a null reference is managed and does not raise a null reference for example by retrieving: x.Property_A.Property_B ...
Mulaga's user avatar
  • 142
-1 votes
1 answer
52 views

Fluent NHibernate adding Where() in mapping constructor doesn't work with subquery

I have this entity mapping: public class ExpedienteNnaMap : ClassMap<ExpedienteNna> { public ExpedienteNnaMap() { Table("personasexpediente"); ...
Carlos Garcia's user avatar
0 votes
0 answers
71 views

Calling stored procedure on Inherited class in [Fluent] NHibernate without discriminators

I have a working Fluent project with some inherited tables class Base { int BaseId } class Derived : Base {} class Derived2 : Base {} class BaseMap : ClassMap<Base> { ID BaseId ); } class ...
Aero9999's user avatar
  • 142
2 votes
1 answer
41 views

Inheritance Mapping Fluent NHibernate results in unnecessary joins

The issue is when selecting directly on the base model the generated SQL performs an left outer select on the subclasses. Basemodel. public class Node { public virtual int ID {get;set;} public ...
user2435866's user avatar
0 votes
1 answer
175 views

How to run an NHibernate SQL Delete with a final SELECT reporting completion?

Description For a project I'm working on, I'm creating a purge feature that deletes old data from this system's database. I've found that, while my SQL works correctly when ran from SQL Studio, it ...
Andrew Gray's user avatar
  • 3,790
0 votes
1 answer
19 views

FluentNHibernate: how to map elements of a list

I have the following classes: public abstract class AbstractGeometry : IGeometry { // something } public class CompositeGeometry : AbstractGeometry { IGeometry MainGeometry { get; set; } ...
Nico's user avatar
  • 132
0 votes
1 answer
104 views

How to map a collection of components as a set in fluent nhibernate

I want to map a collection of components on an entity. The component looks like this: public class PermissionUserSetting { public virtual PermissionType PermissionType { get; set; } public ...
richard's user avatar
  • 12.5k

1
2 3 4 5
110