Questions tagged [fluent-nhibernate]
Fluent NHibernate lets you write NHibernate mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.
5,482
questions
0
votes
0
answers
18
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 ...
1
vote
0
answers
11
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 ...
0
votes
0
answers
9
views
Fluent NHibernate Readonly property after Insert (Audit - type Data Created Updated Dates)
I HAVE to be overthinking this because it's a super common workflow just not finding the right answer. Using Fluent NHibernate over postgres and given the following simple class and mapping, how can I ...
0
votes
0
answers
39
views
ASP.NET MVC FluentNHibernate mappings
I'm trying to give maintenance to a system that uses FluentNHibernate, there is no documentation and I'm trying to figure out how the tables where mapped in the database, the solution is divided on ...
0
votes
1
answer
18
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 ...
0
votes
0
answers
9
views
How to Create And Save CSV File in Mobile Directory in Futter
Any One Know How to Create And Save CSV File in Mobile Directory in Futter.
Please Let Me Know .
I will be thankful to you
0
votes
0
answers
7
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; }
...
0
votes
1
answer
20
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 ...
0
votes
1
answer
25
views
How can I edit the EXISTS clause produced by NHibernate?
How can we override the usage of the HqlExists class for it's usage creating an EXISTS clause in a given NHibernate configuration/dialect?
The driver being used requires that only a single column be ...
0
votes
0
answers
19
views
C# Fluent NHibernate map table with no ID
I need to map a table that has no ID.
I already tried to create a composite ID, but from the data that I have, I can't select the needed fields so that I can create an unique entity.
Is it still ...
0
votes
0
answers
32
views
NHibernate JoinAlias is not creating an alias in the generated SQL
Apologies in advance for how long this question is :) I've tried to make it as detailed as possible. I did have a look for similar questions, but nothing really matched
I have some legacy code I'm ...
0
votes
1
answer
17
views
Fluent Nhibernate Many to many with a pk and fk in one table
Hey i have the following mysql tables:
and i have the following maping classes:
public class WalletMap : ClassMap<Wallet>
{
public WalletMap()
{
Id(x => x....
0
votes
2
answers
41
views
Cannot insert the value NULL into on referenced object
I'm trying to add a new object with nHibernate, but for some reason it tries to update a field on a referenced object that hasn't been provided resulting in:
Cannot insert the value NULL into column '...
0
votes
0
answers
28
views
Fluent NHibernate: How to map FK keys as properties in .NET Core version
we are using fluent API and I need to know how I can map it correctly so we can use ParentId instead of having to go through Parent entity. Is that possible? I know it can be done using EF Core so I ...
0
votes
0
answers
28
views
Saving a list with a reference in nHibernate
I need to save a list of DataNode objects that have a property refering a NodeType objects, but I've tried all kinds of mapping settings, but keep getting errors.
The classes look as followed:
public ...
0
votes
0
answers
20
views
FluentNHibernate's PersistenceConfiguration Cache method removed
new to Fluent/NHibernate and trying to upgrade code base to the latest FluentNHibernate from version 1.1.0.685. The PersistenceConfiguration type used to have a Cache method (below) and no longer ...
0
votes
0
answers
36
views
Database first approach with Fluent Nhibernate, configuring session factory to avoid dropping tables and using reserved words
In my ASP.NET MVC project, I use an ODBC-connection to an off-site database with a large amount of tables, from which i'll just be using a few.
I'm using Fluent Nhibernate to configure my session ...
0
votes
0
answers
27
views
Fluent Nhibernate QueryOver Doesn't Return Actual DB Value
var q = session.QueryOver<FMClass>().OrderBy(x => x.Id).Asc.List();
foreach (FMClass f in q)
{
//f.Name = "Cool"; value from db
...
0
votes
0
answers
16
views
Getting proxy information while retrieving data by fluent hibernate
I have not used much fluent NHibernate so I am confused. When I try to get the information I get the wrong info as shown below. Any tips? This happens when I save a new item, so the problem is in the ...
0
votes
0
answers
35
views
IdentityResult DeleteAsync does not recognize that I deleted a row
I have this delete method that deletes a Client, which has a foreign key 'ApplicationUserId' mapped to my ApplicationUser. It should let me delete the Application user because I already deleted the ...
0
votes
1
answer
19
views
NHibernate: One-To-One-Relationship not correctly updating
I want to map two types, ConnectionProfile to ConnectionType. In my ConnectionProfile I have:
public virtual ConnectionType ConnectionType { get; set; }
in my ConnectionType I have:
public virtual ...
0
votes
1
answer
19
views
FluentNhibernate Map ValueObject
I have the following use case:
public class Object {
long Id
...
ISet<Tags> tags
}
public class Tag : IEquatable<Tag> {
string Label;
}
Object is an Aggregate Root and ...
0
votes
0
answers
86
views
How to share an image with text on instagram story on through flutter?
I am trying to share an image with text on instagram story through flutter and i have tried various plugins to share but every time i can only share an image but not text.How to do it? Please help.
...
0
votes
1
answer
43
views
How to check if there is a person in the database who has exactly two (or more) specific addresses? (QueryOver)
I want to check if there is a person in the database who has exactly two specific addresses.
My proper SQL query:
SELECT name, id FROM person
WHERE person.name = 'Kxxx' AND person.firstname = 'Axxx'
...
0
votes
0
answers
13
views
Fluent NHibernate Mapping multiple tables has relation and joined to each other
As you see the models have references as one to many. list of project is not mapped here. there are more than one project and the project has more than one role and the role has more than one ...
0
votes
1
answer
285
views
could not create the driver from nhibernate.driver.sqlclientdriver, nhibernate, version=5.3.0.0, culture=neutral, publickeytoken=aa95f207798dfdb4
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, version=...
0
votes
1
answer
17
views
Fluently.Configure throws "Database was not configured through Database method" exception
I am trying to get an in-house application up and running for debugging and when I start the solution, it fails calling the Fluently.Configure() method. Digging into the exception, I see the potential ...
0
votes
0
answers
27
views
In my flutter app when i open gps or camera or map , or any url , getting error "Lost connection to device." everytime
I am testing on a real device(Redmi 7A) when I open Camera ,URL,GPS, app always get error "Lost connection to device." but when i test on Samsung m31 or Samsung a51 it works very well.
0
votes
0
answers
31
views
WPF and SQLite 'Value cannot be null. Parameter name: conn' on SchemaExport NHibernate.Tool.hbm2ddl.SchemaExport
WPF application allows users to generate SQLite databased. Randomly I'm getting error on creating database. I'm using fluent mapping.
Error as below. PontentialReasons is empty.
An invalid or ...
0
votes
1
answer
34
views
when tray to build flutter APK
FAILURE: Build failed with an exception.
Where:
Script 'C:\Users\LEGION\flutter_windows_2.2.3-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
What went wrong:
Execution ...
0
votes
0
answers
49
views
In a .NET application, how do you model this SQL relationship?
BACKGROUND TO THE DOMAIN
I have a .NET application with a SQL Server database underneath. Each customer has their own database.
In that database, I have a table called Label which is empty on new ...
0
votes
1
answer
22
views
How to use a WPF-Combo-Box with fluent nHibernate so its saves after the user changes the selection?
This is my ComboBox:
<ComboBox x:Name="comboBoxExchange" HorizontalAlignment="Left" Margin="167,162,0,0" VerticalAlignment="Top" Width="222" ...
0
votes
1
answer
57
views
How to force nHibernate to update referencing objects automaticly?
So I got two fluent nHibernate Tables in sqlite:
public class Product
{
public virtual long Id { get; set; }
public virtual Exchange Exchange { get; set; }
}
public class ProductMap : ...
0
votes
1
answer
15
views
Why does fluent Hibernate .Sum throws InvalidOperationException when used at an empty table?
I am using fluent Hibernate in C# to query a sqlite-database.
So this code works fine when there is at least one CashTransaction in my database.
public decimal? GetSum(ISession dbSession)
{
var ...
0
votes
0
answers
59
views
Fluent Nhibernate throwing error while connecting to Oracle Database
On my console app I am using Fluent Nhibernate as ORM. Below shown is my code. I am getting below shown error when "new SchemaExport(config).Create(false, true) "; line is executed in ...
0
votes
0
answers
51
views
Is mapping syntax in C# different for Oracle and SQL Server db for Fluent NHibernate?
I want to use Fluent Nhibernate ORM in my C# project that needs to connect to Oracle and SQL Server database. I know that I need to create mapping file to map my C# objects to database objects but ...
0
votes
2
answers
272
views
Flutter Button It should be pressed once in a day
Is there any where I can make a button to be pressed only once in a day.
You cannot press that button again in that day.
you need to wait till next day inorder to press it again
...
0
votes
0
answers
25
views
Nested query with NHibernate by Criteria
I want to know how I can query fields of subquery(nested query) in NHibernate by Criteria.
something like this
SQL Sample:
select * from (
select id, name from table1
)T
Where id =12
...
-1
votes
1
answer
46
views
NHibernate Short-Circuit Lazy Load to Pull from Cache
I have some legacy code that does lots of lazy-loading of lots of "static" records, and produces a lot of N+1 alerts in NHibernate Profiler, which I'm trying to fix. I've found that by ...
0
votes
2
answers
496
views
error in flutter code of putting image inside flutter
import 'package:flutter/material.dart';
// import 'package:';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget
{ @override
Widget build(BuildContext context) {
...
0
votes
0
answers
14
views
NHibernate value generated by SequenceIdentity is not fetched from database after object insert in database?
I wanted the non-primary key to be generated by the sequence. The booking reference value is generated in the database successfully but that value is not being fetched from the database after insert.
...
0
votes
1
answer
46
views
How to include records from 2 db tables into a single view using NHibernate / Fluent NHibernate?
I'm new to NHibernate / Fluent NHibernate (started with it this weekend) and I'm having difficulties solving the following.
I have 2 SQL Server tables:
[Client]
ID INT NOT NULL ...
0
votes
0
answers
17
views
FluentNHibernate mapping with fixed values
I have a simple database table that contains a column "ObjectType" whose values indicate the type of the object represented by the row.
Code
Description
ObjectType
Note
ABC
Description for ...
0
votes
1
answer
167
views
NHibernate CacheException: StackExchange.Redis configuration string was not provided
I'm setting up caching using Redis for NHibernate. I have followed the documentation on how to set up this. The only difference is I did not use the below implementation.
<property name="cache....
0
votes
0
answers
15
views
Fluent nhiberbate component is always instantiaded
I want with Fluent nhibernate use component with a condition.
When Description1 is null the property ClassA of MainClass must be null, otherwise the property contain an instance of MyClass with ...
0
votes
1
answer
32
views
Map property whith where condition
I have one table for 3 entities:
Password, Note, Credit Card.
The table has an "EntityType" column.
For example, for the password there is the value "P".
How do I make Mapping so ...
1
vote
1
answer
45
views
Fluent NHibernate table-per-hierarchy mapping fails to discriminate child collections
I'm using table-per-hierarchy to persist Cat and Dog objects the same table. They both inherit from Animal. Another object (AnimalOwner) has two collection properties - Cats and Dogs. When the ...
3
votes
0
answers
126
views
how to create a foreign-key relationship without holding a reference to the father entity in fluent NHibernate
I can't create a foreign-key relation ship with this setup. Please help!
I have 3 classes:
Class Father
{
Public Guid Id //This is the PK but I DON'T want to use this
Public GuidWrapper ...
0
votes
0
answers
30
views
Fluent Nhibernate Sqlite Linq where statement issue
return _session.Query<Artikel>()
.Where(x => artikelReferences.Contains(x.ArtikelReference))
.Select(x => new ArtikelStockInformation
{
ArtikelReference = x....
0
votes
0
answers
37
views
Nhibernate mapping in c#
Component(a => a.Id, b => {
b.hasOne(e=>e.x).Fetch.Join.Cascade.All() });
I have written this in my code. It shows error. How to write hasone relationship inside a component statement?