Most voted "nhibernate" questions
Nhibernate is an open source object-relational mapper (ORM) for the . NET library.
Learn more…108 questions
Sort by count of
-
41
votes4
answers4635
viewsTo what extent is it not advisable to use an ORM?
I am working on a very large system using . NET (ASP.NET MVC) the application requires a critical level of performance. How worthwhile or not to use a ORM? Is there a tool that I can compare in…
sql entity-framework software-engineering nhibernate ormasked 10 years, 6 months ago Tuyoshi Vinicius 4,046 -
9
votes2
answers960
viewsHow to save a cascade collection in nhibernate without putting circular reference?
Always when I try to save an object with a data collection mapped as HasMany I have to put a circular reference so that Nhibernate can save this object in cascade. For example I have the following…
-
4
votes1
answer226
viewsHow to make "OR" between Subquerys using LINQ C#
I would like to implement with LINQ C# (Using Nhibernate as ORM), the following query: return (from t1 in Session.Query<Tabela1>() join t2 in Session.Query<Tabela2>() on t1 equals t2.T1…
-
4
votes1
answer152
viewsWhat would Take and Skip be in Linq?
I am doing maintenance on a system and found a GetAllQueryable(), using the method Take() and Skip(). Well, I don’t know what they are or what they’re for, I looked them up but I couldn’t find…
-
4
votes2
answers466
viewsMulti Banks / Cache / Client Layer
We are studying ways to develop some features for a system, which will be in C# . Net. I’d like to hear opinions on how we can do this, if we can use some frameworks or something else. Access to…
-
4
votes1
answer562
viewsView SQL at Runtime
Is there a monitor that shows me the sql script at runtime? For example, during debug, I would like to see how the script was mounted by the following code: var q = (from proc in…
-
4
votes1
answer1938
viewsc# Nhibernate a Different Object with the same Identifier value was already Associated with the Session
I’ve been with that mistake for a while and I can’t find a good solution. Saving objects works normally, but for changes it returns me this message: Additional information: a Different Object with…
-
3
votes1
answer295
viewsMap a CHAR-like field in the database to a bool-like field in C#, with Fluentnhibernate?
In the database I have a field ATIVO of the kind CHAR(1), where 'T' = true and 'F' = false. Today, in my application I am circumventing this problem with a "gambiarra", where I mapped my attribute…
-
3
votes2
answers497
viewsIs there any other way than with HQL, to bulk update with Nhibernate?
I need to do a routine that will set one flag in several records that meet some requirements, and would like to keep this in control of the Nhibernate. However, I couldn’t find any way to do a mass…
-
3
votes1
answer245
viewsHow to map a read-only property in Fluent nhibernate, error when identifying Setter
I have a property that must be read-only, I performed mapping via code and assigned the parameter to read-only, however, it presents me an exception stating that the property’s Setter was not…
-
3
votes2
answers265
viewsError Nhibernate System.Invalidcastexception - Manytoonetype to Componenttype
Exception: System.Invalidcastexception: It is not possible to convert an object of type 'Nhibernate.Type.Manytoonetype' to type 'Nhibernate.Type.Componenttype''. The classes involved are: public…
-
3
votes2
answers86
viewsORM that can connect with 2 BD types (SQL or HANA)
Any suggestion of a ORM or Micro ORM that can connect/manipulate 2 different database types, not Imultaneos? The scenario: I already have an application that uses SQL, I need to adapt it to accept…
-
3
votes1
answer533
viewsFluent Nhibernate with multiple tables
I’m using the Fluent NHibernate to assist the ORM (replacing the manually made . hbm files) with a single class: User class: public class Usuario { public virtual int Id { get; set; } public virtual…
-
3
votes2
answers2261
viewsI need to do a SUM inside Group BY in Lambda
I’m trying to create a summary report where it consists of making a GROUP BY with SUM, i want to know how I could do it in c# with lambda or hql(Nhibernate), I managed to do a GROUP BY, but I can’t…
-
3
votes0
answers284
viewsUsing JOIN with HQL function in Nhibernate?
I am trying to run a JOIN using HQL with Nhibernate and returns an empty list. How to do this ? I’m trying like this. [Serializable] public class Cliente { public virtual int id { set; get; } public…
-
3
votes1
answer274
viewsUse of async with . NET Core and nhibernate
No. NET Core I know we have the async and await for request async. So far so good, but many frameworks in the market are creating methods with the signature MetodoAsync() and has the method without…
-
2
votes1
answer820
viewsHow to create a query with Union using Nhibernate
I need to implement a query in nhibernate make a union between 2 tables. In sql, it would be something like that: SELECT T1.Id AS ID FROM TABELA1 AS T1 UNION SELECT T2.Id AS ID FROM TABELA2 AS T2 I…
-
2
votes1
answer761
viewsDifference between Nhibernate first and second level cache
When searching for cache within Nhibernate, I found that there are two levels of cache that can be used, the first level and the second level. I found articles with implementations of both types and…
nhibernateasked 10 years ago Matheus Bessa 1,261 -
2
votes0
answers425
viewsCriteria: Subquery with multiple columns
I have the problem and I can’t solve it. How to turn this query into Nhibernate Criteria. SELECT ordid, prodid, qty FROM item WHERE (prodid, qty) IN (SELECT prodid, qty FROM item WHERE ordid = 365)…
-
2
votes1
answer99
viewsnhibernate save string in upper case (uppercase)
Hello, is there any nhibernate mapping option to save the fields string on-mode uppercase? Thank you.
-
2
votes1
answer283
viewsIs there any way to set Nhibernate not to parameterize a query?
Problem I have an appointment with Linq Nhibernate in which subquery I need to concatenate the results with a separator to compare it with the query is similar to the following:…
-
2
votes1
answer139
viewsnhibernate with more than one database
Hello, I wonder if it is possible to use nhibernate with more than one database, some tables will be in one database and others in another. How would I do that? And in entity mappings, how would I…
-
2
votes1
answer55
viewsSql generated by Linq
Hello, I would like to know how to see the sql code that a String expression generates to be executed by ADO.Net. I am using Nhibernate as a ORM framework.
-
2
votes1
answer236
viewsIs using the oid column in Postgresql as the primary key correct?
Postgresql creates by default the Oids column (object identifiers), you can get it by doing. select oid, * from table Problem that I have a table that has no primary key, and I want to map it in…
-
2
votes1
answer64
viewsWrite file to database with Nhibernate
It is possible to serialize and write file in database with Nhibernate? public virtual File Arquivo { get; set; } He does not let map and did not want to record without using Nhibernate to follow…
-
2
votes2
answers10059
viewsRead or write attempt in protected memory
I have an application in C# connecting to the database Oracle. For this the application makes use of the Nhibernate (a very old version) and Castle Activerecord. This always worked, however, now…
-
2
votes1
answer1102
viewsFluent Nhibernate - Composite Key Mapping
Greetings, I’m having a hard time and I can’t fix it. I have an application where I created the mapping and everything was working perfectly, but now I need to change it and that’s where the problem…
-
2
votes1
answer45
viewsI can’t perform a Repository search with Nhibernate C#
I’m new as a programmer, sorry if I can’t explain clearly, but please tell me what I did wrong and if possible how to do better, I want to improve as a programmer and user here at Stackoverflow I am…
-
2
votes2
answers351
viewsApply between in an hql in c#
I am trying to apply a between with two fields of a part of my form, are dates and vehicle ids, I do not have much knowledge of how it models this by HQL in nhibernate with c#, I wonder how it would…
-
2
votes2
answers528
viewsHow to use the SUM aggregation function in a NHIBERNATE query?
My consultation consists in knowing the NumCarroId, TotalGasto and VlrUnit, in Sql I managed to do that but when I play in HQL returns the following error: Application of GROUP BY next to the SUM to…
-
2
votes0
answers24
viewsHow to get the count and objects with jpa criteria?
need to return the grouping results and also the number of each item of a query with criteria jpa. public List<Dica> obterDicaPorUsuario(){ final CriteriaBuilder cb =…
-
2
votes0
answers88
viewsIt’s not overwriting the value
I’m wanting the final calculation information to overwrite what is already saved in the Stock table, as it would be to do this, because Save, is overwriting correctly, I tried to apply in the…
-
2
votes1
answer55
viewsCan I use Nhibernate with Docker?
I have a personal project on ASP.NET MVC core that supports Docker. I would like to use Nhibernate to persist and retrieve information. In my searches I have not found anyone who uses. I am trying…
c# asp.net-core docker nhibernate fluent-nhibernateasked 5 years, 6 months ago Henrique.Eichstadt 29 -
1
votes0
answers205
viewsHow to use Nhibernate cache with C#
Guys, how can I use cache in Nhibernate with C#? What is the best way to implement? And what considerations should I take?
-
1
votes1
answer412
viewsEntity with simple key referencing another with composite key
I am using Fluent Nhibernate for mapping my classes, and I have the following situation: User class public class UsuarioMap : ClassMap<Usuario> { public UsuarioMap() { Table("USUARIOS"); Id(x…
-
1
votes1
answer68
viewsConfiguration table
How could I use a configuration table in nhibernate? That is, a table of only one record and that it only controlled this record, I know you have how to do this via application, but I wanted to know…
-
1
votes1
answer756
viewsFill foreign key with primary key value
I am doing an application with ASP.Net MVC and Nhibernate, I have a company registration and a customer registration, where a company can have several clients. The classes are already mapped to the…
-
1
votes1
answer217
viewsSlowness with Fluentnhibernate
I am using Fluentnhibernate in a simple product registration application. The first time I run something that accesses the database (product query screen or register a product) the site is loading…
c# asp.net-mvc nhibernate fluent-nhibernate asynchronousasked 8 years, 6 months ago Vitor Ferreira 48 -
1
votes0
answers154
viewsQuery using Firebird "SUBSTR" with Inline, QueryOver, Criteria
Guys, I need to create a query using the "SUBSTR" function of Firebird with Line, queryOver or Criteria. I have option to create with HQL or SQL, but these would be my last options. Anyone have an…
-
1
votes1
answer111
viewsMappingnhibernate
How do I map a table that has a composite key in Nhibernate? For example: I have a table called configuracao. This table has a reference to the table local_estoque. Normally a map would look like…
-
1
votes1
answer505
viewsInheritance with Relationship of 0:N using Nhibernate
I have the following situation: Person public class Pessoa { public Pessoa() { Endereco = new List<Endereco>(); } public virtual int IdPessoa { get; set; } public virtual string Nome { get;…
-
1
votes1
answer809
viewsQuery using LINQ and Nhibernate
I need help in a query you should search for: PK_PARENT, NOME_PAI, {NOME_FILHO1, NOME_FILHO2, ..., NOME_FILHO*} For research I have already tried to do research in some ways like: var listaPai =…
-
1
votes0
answers81
viewsBag nhibernate with key null
Hello, Does anyone know if it is possible to use nhibernate Bag with Key Null? In a table some records have several related records, one for many, but not always, sometimes a region will not have…
-
1
votes1
answer60
viewsSearch result Nhibernate C#
I am making a query in Nhibernate, but I am not able to bring the desired result, I want to bring all my table items file that have no relation to another table called Layouts, I tried to use a…
-
1
votes2
answers108
viewsCreate Database using Fluent Nhibernate
Is there any way to create a new database directly from my application? I’m using Asp.Net MVC5 C#, Fluent Nhibernate and Postgresql. Note: I can already access my tables through the application,…
-
1
votes1
answer409
viewsASP.NET MVC: Automapper and Nhibernate
Good night, I have a problem. I am using nhibernate to connect to my database and also use Automapper to map my Entities to my Viewmodel. But when I select the entity I have several relationships…
-
1
votes1
answer233
viewsQuantity limit in database query
public IList<DtoContrato> ConsulteListaPorListaDeIds(List<Guid> listaIds) { return Conversor(Persistencia().Where(x => listaIds.Contains(x.Id))); } My question is, if the list of ids…
-
1
votes0
answers27
viewsNhibernate keep two Mapping for a single object
i would like to keep two different mappings for a single object is possible to do this with Nhibernate?
-
1
votes2
answers658
viewsMapping Composite key nhibernate with Firebird bank
Guys I’m having difficulty in mapping composite primary key using nhibernate Fluent. I have the following class: public class NotaItem { public NotaItem(){} public virtual int Id { get; set; }…
-
1
votes1
answer601
viewsCreating Mysql connection with Fluentnhibernate?
I am trying to create a connection with Mysql using Nhibernate and Fluentnhibernate. I added by nuget the MySql.Data but when I try to make the connection MySQLConfiguration not found in context.…