Most voted "fluent-nhibernate" questions
Framework to assist in secure and automated mapping, without convention-based XML for Nhibernate
Learn more…55 questions
Sort by count of
-
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…
-
7
votes1
answer786
viewsFluent Nhibernate - Composite key mapping one to many
I’m having a problem mapping an entity through Fluent Nhibernate. I have a 1-N relation to the two tables in the bank having composite keys. When I try to list my entity User an error comes back,…
-
6
votes1
answer116
viewsSort 2 columns at a time - Asp Mvc + Fluentnhibernate
Good morning! I would like to know how to order two columns at once in a query so that in my case, 1 in descending order of date but in alphabetical order. public IList<Analise>…
-
5
votes2
answers2331
viewsHow to use the nhibernate Fluent appropriately?
A problem I have encountered due to the inexperience with this type of tool is HOW to use Lazy load without interfering with the software architecture. I use the following architecture: HMI (Human…
-
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…
-
4
votes2
answers2552
viewsClaims Identity MVC
I’m having difficulty implementing Claims to make user authorizations in my project, I’ve read a lot but I can’t execute it. I’m using in the project the Nhibernate.AspNet.Identity may be that for…
c# asp.net-mvc asp.net-mvc-5 asp.net-identity fluent-nhibernateasked 7 years, 5 months ago Eluander J. F. Lopes 400 -
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
answer836
viewsReceive by Parameter and Manipulate a Generic Object LIST
I need to receive an Object List by parameter Generic and manipulate, although researching did not understand right how to do. Example: public class Funcionario { public long Id {get; set;} public…
-
3
votes2
answers1107
viewsError returning list with Fluent Nhibernate
Within the Web.API project, I created a Get() method which returns a list of objects - Ilist. This Personal Classaccess has a Log list (1:N). When executing the Get() method, an exception occurs:…
-
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
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
votes1
answer98
viewsForm losing model list
I have the following models: Models public class Atividade : BaseEntity { public virtual int Id{ get; set; } public virtual string Descricao{ get; set; } public virtual IList<Anotacao>…
-
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
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…
c# postgresql nhibernate fluent-nhibernate primary-keyasked 8 years, 1 month ago Marco Giovanni 2,768 -
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
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
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, 7 months ago Henrique.Eichstadt 29 -
2
votes1
answer110
viewsGet a list of mapped data in Nhibernate
I am trying to transform the data returned from the database to the settings made in my mapping, however I get the following criticism: "The value "System.Object[]" is not…
-
2
votes1
answer44
viewsFluentnhibernate is mounting the wrong query
Dear, After mapping the tables, I consulted one of them to return the information "daughter". The sql was mounted correctly, however the name of the key column (PK) was changed which made an error…
-
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
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, 7 months ago Vitor Ferreira 48 -
1
votes1
answer161
viewsHow to know if the client is already open on another computer?
I’m building a system that can and will open on possibly two to seven computers. There is concern in the following case: PC1 opened the João client file and began editing. PC4 opened the João…
-
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
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
answers272
viewsCreate Database with Fluentnhibernate
Is it possible through Fluentnhibernate to create the database as tables are created? I have the following class: public class Helper : IRepositorioHelper { private static ISessionFactory…
-
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
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
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.…
-
1
votes1
answer272
viewsYou doubt with Fluentnhibernate mapping?
I am trying to create a scheme to define permissions on my system and these permissions are given to the user profile, where one can choose what each profile is authorized to do on each module. For…
-
1
votes0
answers269
viewsINNER JOIN FETCH Nhibernate is not filling properties
I have the following query in HQL: select photoRating from PhotoRating as photoRating inner join fetch photoRating.FormularioRespostaDoUsuario as form inner join fetch form.Trecho as section And…
-
1
votes1
answer385
viewsTrying to update with Nhibernate?
I’m trying to do an update with Nhibernate but always returns me an error saying that there are two sessions open: illegally attempted to associate a proxy with two open session How to solve this ?…
-
1
votes1
answer118
viewsProblems with creating not null fields with Fluentnhibernate
I have a problem creating the fields using Fluentnhibernate and Postgres. User class: public class Usuario { public virtual int idUsuario { get; set; } public virtual string nome { get; set; }…
-
1
votes1
answer54
viewsIncrease field size varchar (existing in database) with Nhibernate
Let’s say that this field with size 11 exists in the database, in several clients.. Map(x => x.CpfCnpj).Not.Nullable().Length(11); And one day I need to increase it to . Length(14). Is there any…
-
1
votes0
answers22
viewsFluent Nhibernate does not load daughter tables
I have 3 related tables: Lesson (Id (PK), Name) Lessonquestion (Id (PK), Lessonid(FK), Title) Lessonquestionanswer (Id (PK), Lessonquestionid(FK), Value) My Model: public class Lesson : Entity {…
-
0
votes1
answer355
viewsdoubts when mapping nhibernate
I have the following scenario: public class ExemploDTO { public virtual int Id { get; set; } public virtual List<PessoaDTO> Cliente { get; set; } public virtual ServicoDTO Servico { get; set;…
-
0
votes2
answers60
viewsGenerate Quence for Field
It is possible for me to create a quence without changing the field to id? Id(x => x.Id).GeneratedBy.Identity(); Map(x => x.DocumentoNumero); Using this example, I would like to keep a quence…
-
0
votes1
answer350
viewsHow to change the name of the References column by Fluent Nhibernate?
In the "LOG" class, I am trying to enter the column name, which is a FK, using Fluentnhibernate References. I have the following class structure: public class Pessoa { public virtual int Id { get;…
-
0
votes1
answer210
viewsError returning data using Fluent Nhibernate (Many to Many)
I have a relationship of many to many (M:M) using Fluent Nhibernate: Class/Map - Unit: public class Unidade { public virtual int Id { get; set; } public virtual string Descricao { get; set; } public…
-
0
votes1
answer393
viewsInjection of dependency with Ninject
I’m using Ninject on ASP.Net MVC and trying to implement, but I’m getting a bug: Error Activating Isessionfactory No matching bindings are available, and the type is not self-bindable. Activation…
-
0
votes1
answer282
viewsEntity mapping oneToMany with Fluent Nhibernate
Gentlemen, my problem apparently is simple, I must be doing or forgetting something and I just can’t see the error. Can you help me? I have the class Cliente: public class Cliente { public Cliente…
-
0
votes1
answer208
viewsProblem rescuing References from a query in Nhibernate Hasmany
I’m using Nhibernate with Webapi have 2 entities Profile & Personal Personal Login may have N Profile and Profile 1 Person Login. However, when I go to the Personal webservicelogin the Profile…
-
0
votes1
answer71
viewsIgnore property with Fluentnhibernate?
I’m trying to ignore a class property for mapping with Fluentnhibernate and I’m not getting it. I’m trying to follow this example link. How to do this ? trying to. public class Caixa { public…
-
0
votes1
answer62
viewsHow to remove an object from a Hasmanytomany relationship?
I have 2 entities that relate: Entities Empresa and FormaPagamento many companies may have many forms of payment, to save this working well but now I want to remove the forms of payment that the…
-
0
votes1
answer193
viewsNhibernate Self-reference Mapping
Hello, I need to return a list of child objects of the same kind as the father. however, using nhibernate, it only returns one child object, while in the bank I have 3 children. Below are excerpts…
-
0
votes1
answer143
viewsFluentnhibernate.cfg.Fluentconfigurationexception.Getobjectdata how to resolve?
I have a site that I use Fluentnhibernate and now I uploaded this site to the provider but when I try to open the site shows me some Exceptions of Fluentnhibernate. This site, on my computer, works…
-
0
votes1
answer84
viewsHow to bring all items that have no reference with a given table [SQL]
I am using Nhibernate to make a query in sql in C#, but I have a doubt. I have the following structure: public class Pessoa { public long Id {get; set;} public string Nome {get; set;} } public class…
-
0
votes1
answer415
viewsUsing Elements like "Not Exists" and Sub Query in LINQ, LAMBDA EXPRESSION and Nhibernate
Good Morning, I have a query to be executed in my database, however, here in our projects we use Nhibernate as a ORM tool. I’m having difficulty passing this SQL query to a syntax used with…
linq lambda-expressions nhibernate fluent-nhibernate linq-to-sqlasked 6 years, 3 months ago Italo Angelo 3 -
0
votes0
answers23
viewsNhibernate with list of objects changing objects linked by FK
A Document has a Items list mapped with Cascade all (when saving the document, items must be saved). Each item has a reference to the FK of the previously registered product. When opening the…