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
-
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
votes2
answers449
viewsHow to create summation with "sum" with multiple queryover columns
People need to create a query with queryOver(Nhibernate) C#, to add more than one column. Example in pure sql: SELECT SUM(coluna1 + coluna2 + coluna3 + coluna4) FROM tabela First I did so: Tabela…
-
1
votes1
answer98
viewsNhibernate is modifying property when returning by Web Api
I have a web service api where a query to the bank is relaunched through nhibernate, but when returning the object, its referenced properties are overwritten, I believe it is because of the…
-
1
votes3
answers510
viewsTake class property C#
People need to take all property of a class that is of class type. Ex: public class Pessoa{ public virtual int? Id { get; set; } public virtual MinhaClasse1 prop1{ get; set; } public virtual…
-
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
answer145
viewsRunning Query with SUM in HQL?
I’m trying to use the SUM to sum an attribute of an entity using HQL of NHibernate, but whenever I execute the query returns empty. I am following the example here but I still can’t do it. How to do…
-
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
votes1
answer168
viewsReturns query value in a variable
Precise returns the value of a query query in an int variable, to be able to make the comparison with my Textbox, but I cannot make the comparison because I cannot compare integer(textbox) with a…
-
1
votes1
answer67
viewsPlace the value of an hql on a var
I need to get my two tables to work together, where the Abastecimento take the Product Name(NomeProdutoId), table Compra, I managed to get him to take the Product Name, but I wanted him to bring me…
-
1
votes1
answer89
viewsError when placing SUM
I’m trying to implement the SUM within those lines of code to sum the two columns Litro and TotalGasto Code: var teste = consulta.Where(i => i.DtAbastecido >= dataInicio &&…
-
1
votes1
answer97
viewsProblem saving
Only a form that is returning me this mistake, the question that I do not know what can be or how to fix, some ask to cascade the relationship that is already. Nhibernate.Transientobjectexception:…
-
1
votes1
answer79
viewsNhibernate consuming a lot of memory
I have an application that connects to the database via NHibernate, with this some operations are carried out as Save, Update e Delete. However, when performing these procedures, it is incredible…
-
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 {…
-
1
votes0
answers41
viewsDoes not enter into Oracle bank, with Nhibernate
I have a problem in an application, developed in C#, that uses Oracle database, and access the database with Nhibernate. When trying to perform the Saveorupdate() function, the Insert is not done…
-
1
votes1
answer137
viewsNhibernate Querysyntaxexception
I am trying to return the amount of objects that a query will return. If I execute the following command: query.ToList().Count The value is returned successfully, but I execute the following…
-
1
votes0
answers37
viewsHttpselfhost Serialize daughter entities + Session nhibernate
I have the following method: // GET: api/Pedido/5 [ResponseType(typeof(Orcamento))] public IHttpActionResult Get(int id) { using (OrcamentoRepository or = new OrcamentoRepository()) { var orcamento…
-
0
votes1
answer247
viewsLarge volume data loading with Nhibernate + Windows Forms
I use the ORM Nhibernate in a windows Forms project and there is a forecast to work with a large volume of data in several tables, ranging from 1 to 15 thousand records on average. Although it is…
-
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
votes1
answer309
viewsHow to create Detachedcriteria criteria for a field from a Join table?
First time I move with this and I’m having trouble fitting the query properly. Here’s my code done the wrong way, so you’re not obeying the conditions: public IList<Ficha> ObterFichas() {…
-
0
votes1
answer73
viewsMapping Onetomany Nhibernate
Hello, In an application has a class that I need to do a Onetomany mapping, this parent class will be responsible for performing the persisntecia of the daughter class. My question is, I mapped Bag…
-
0
votes1
answer401
viewsNhibernate create database?
I am a Java developer and work with Hibernate. Now I need to create a desktop application and decided to use C# for this. I’ve been researching ORM frameworks for C# and found Entity Framework and…
-
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…
c# asp.net-mvc asp.net-web-api nhibernate fluent-nhibernateasked 9 years, 11 months ago Daniel Machado 1 -
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
votes2
answers78
viewsSerialize Nhibernate object for JSON
How can I serialize a Nhibernate object for JSON. When I try to serialize error by saying that it is not possible to serialize an object in context.
-
0
votes2
answers636
viewsForeach in Foreach
I need to do a foreach inside another but are two tables one is called categories and the other is a galerya, I need to return all galeryas within each category only that the name of the category…
-
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
answer100
viewsI need to convert a string to int within an hql
I need to change the string to int, however it is located within an hql, I probably have to finish the query, but it error to enter the database, my code is a c# with Asp.net, mvc, nhibernate.…
-
0
votes1
answer329
viewsQuantity Inventory Management
Personal I am trying to do a stock control, my idea is when I consume a product it changes in the table. Ex: Estoque: Produto / Quant Caneta /5 Papel / 10 Lapis / 20 But when I separate these items…
-
0
votes1
answer54
viewsNhibernate + . Netframework 3.5
Would anyone know which is the latest version of Nhibernate that works on . NET 3.5? I even searched the site itself, but could not find it. The one I own is 2.1.0.4000.
-
0
votes0
answers41
viewsProblem on application startup?
I have an application on Asp.net mvc 5 hosted on a dedicated server and in some moments when the Application Pool is unused and the IIS raises it on the first access I’m getting the following error:…
-
0
votes1
answer231
viewsComparing Dates in string, using Sqlite and Nhibernate
I am using Sqlite and Nhibernate, and I am saving in my bank the Datas as String in Sqlite, as it is not possible to store dates in it. Everything was going ok, but I needed to compare dates to…
-
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
answer656
viewsIsession +Nhibernate (no Session or Session was closed)
In a Windowsforms project Using Repospository pattern, in a Generic class I have the following method: public IList<T> Listar() { using (ISession session =…
-
0
votes1
answer64
viewsQuery return problem
I have a problem with my query return. public IList<Rota> Lista() { //* string hql = "SELECT * FROM Rota WHERE ORDER BY Km_Atual ASC"; string hql = "SELECT Km_Atual, MAX(DtLancamento) FROM…
-
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
answer83
viewsError trying to register
Good afternoon, the moment I try to register in the form, I program in the language c# with Asp.net, Razor and Nhibernate. This is my DAO public IList<Rota> Comparacao() { //*string hql =…
-
0
votes1
answer48
viewsIf it has no value to compare, save without comparing
I’m trying to make my application save if it has no value to compare, however you are always going through the comparison, I tried to put an if but still problem, this is the class that makes the…
-
0
votes2
answers544
viewsSave date and time?
I wanted to know how to save the date and time in the bank, and the time I wanted to pull automatically from the machine or server. So I was able to record the date, but the time is zero. Man…
-
0
votes0
answers17
viewsHow to leave a maskedbox
How do I leave values as real value, not a common number. I need these values to be as 2.00, if possible leaves R $ 2.00 My Controller: public ActionResult Adiciona(AbastecimentoModel viewModel) {…
-
0
votes1
answer206
viewsPick up information using a dropdownlist as select
I need to make a basic supply system, where when selecting the type of fuel, it brings me the last registered value of that product and automatically select and still automatically insert in Textbox…
-
0
votes1
answer56
viewsError when registering in the form
When you select the value and I will register informs me an error. System.Argumentexception: The value "System.Object[]" is not of type "Blogweb.Models.Compra" and cannot be used in this Generic…
-
0
votes0
answers47
viewsInsert with composite objects
get this json { "Name": "Teste", "ExpirationDate": "/Date(1515703416000-0200)/", "Program": { "Id": 1 }, "Resource":{ "Id": 1 }, "InsertDate": "/Date(1515703416000-0200)/", "InsertUserId": 8,…
-
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
votes0
answers38
viewsRun nhibernate on macOS X 10.13.3 (c#)
Good morning, I’m new to the world of C# programming and therefore had some problems compiling a project by visual studio for mac. The problem was this, the project uses version 4.0.3 of nhibernate…
-
0
votes0
answers75
viewsDoes not update value
Calculus and values return me all right, but when overriding the previous value and add the new one it does not change, keep the old one. Compra Controller: public ActionResult Update(CompraModel…
-
0
votes1
answer510
viewsSql Server Fluent Nhibernate Connection
I’m having trouble configuring connection to Sql Server database I have this connection method but give me this error message when running the application public static ISessionFactory CriaConexao()…
-
0
votes0
answers436
viewsNhibernate error: No persister for
I would like some help regarding the error presented when I try to record records with Nhibernate by XML mapping. The project has separate layers. In the domain project, is my entity: namespace…
-
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, 2 months ago Italo Angelo 3