Questions tagged as 'nhibernate'

1
answer

I need to convert a string to int inside a hql

I need to change the string to int, but it is located inside a hql, I will probably have to terminate the query, but it from the error to enter the database, my code is a c # with asp.net, mvc, nhibernate. public void soma(Rota post) {...
asked by 13.06.2017 / 18:00
1
answer

Generate sequence for field

Is it possible to create a sequence 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 sequence for DocumentoNumero , but at the sa...
asked by 11.05.2017 / 15:44
1
answer

ISession + NHibernate (no session or session was closed)

In a WindowsForms project Using standard repository, in a generic class I have the following method: public IList<T> Listar() { using (ISession session = SessionFactory.Instance.GetSession()) { return (from c...
asked by 17.01.2017 / 14:12
1
answer

How to remove an object from a HasManyToMany relationship?

I have 2 entities that relate: Entities Empresa and FormaPagamento many companies can have many forms of payment, to save this working well but now I want to remove the forms of payment that the company has and I can not. How to...
asked by 25.10.2016 / 16:49
1
answer

Comparing dates in string, using SQLite and NHibernate

I'm using SQLite and NHIbernate, and I'm saving my Datas as String in SQLite because I can not store dates on it. Everything was going ok, but I had to compare dates to print a report. Now, I can not make this comparison because it...
asked by 04.11.2016 / 13:39
0
answers

Problem in application startup?

I have an ASP.NET MVC 5 application hosted on a dedicated server and at some times when the Application Pool is unused and IIS raises it on the first access I am getting the following error: System.ArgumentException: Source array was not long...
asked by 28.07.2016 / 12:38
1
answer

OneToMany entity mapping with Fluent NHibernate

Gentlemen, my problem is apparently simple, I must be doing or forgetting something and I just can not see the error. Can you help me? I have class Cliente : public class Cliente { public Cliente () { } public virtual...
asked by 08.07.2015 / 14:05
1
answer

Mapping 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 persistence of the child class. My question is, I did the mapping of the Bag in the parent class as below:...
asked by 04.09.2015 / 21:58
1
answer

How to create DetachedCriteria criteria for a field in a join table?

First time I move with this and I'm having trouble setting up the query properly. Here is my code done the wrong way, so it is not obeying the conditions: public IList<Ficha> ObterFichas() { DetachedCriteria criteria = Det...
asked by 07.05.2014 / 19:38
1
answer

System.NullReferenceException was unhandled by user code [duplicate]

When compiling my application I received this error from the image below, would anyone know how I could solve it?     
asked by 27.03.2018 / 14:47