Re: [nhusers] [OT] Where Are You From?

2010-03-04 Thread Felipe Oriani
Brazil On Wed, Mar 3, 2010 at 6:20 PM, Josh Coffman joshcoff...@gmail.com wrote: @joshcoffman AZ, USA ..for now anyway Josh C. 480-270-4578 | josh [at] computeristsolutions [dot] com | http://computeristsolutions.com On Wed, Mar 3, 2010 at 12:36 PM, Jose A. Salvador Vanaclocha

[nhusers] Custom Update (Nhibernate)

2010-06-25 Thread Felipe Oriani
Hi guys.. I have a entity at my model that has about 30 properties mapped with a table in database and in the entity I have a boolean field called Enabled. In my repository, I have a method to Able a entity, so my code is something like this: public bool EnAbled(long id) { var entity =

Re: [nhusers] Re: Custom Update (Nhibernate)

2010-06-25 Thread Felipe Oriani
Hi Kor... thanks a lot man! I'll try it... i didn't know that HQL supports Update commands... =D []'s On Fri, Jun 25, 2010 at 8:53 AM, kor korkl...@yahoo.it wrote: note: you don't need to explicitly saveorupdate an object loaded by session note2: usually there's no performance penalty

[nhusers] Session per Request (Json calls)

2010-06-26 Thread Felipe Oriani
Hi all, I'm developing an application using Asp.Net MVC. I've developed a session per Request... so when the browser request something from server, the app start an session. By the way, I have a page in my website that each second does a asynchronous request by Json to take some information at

Re: [nhusers] Session per Request (Json calls)

2010-06-26 Thread Felipe Oriani
. On Sat, Jun 26, 2010 at 6:18 PM, Felipe Oriani fbori...@gmail.com fbori...@gmail.com wrote: Hi all, I'm developing an application using Asp.Net MVC. I've developed a session per Request... so when the browser request something from server, the app start an session. By the way, I have a page in my

Re: [nhusers] Re: why formula uses plain sql

2010-07-02 Thread Felipe Oriani
Yeah... I agree! I'd like that in the next version that could be added right =D On Fri, Jul 2, 2010 at 1:21 PM, Fabio Maulo fabioma...@gmail.com wrote: the tag is: lazy=extra On Fri, Jul 2, 2010 at 7:53 AM, Jason Meckley jasonmeck...@gmail.comwrote: if you want to implement this

Re: [nhusers] Re: why formula uses plain sql

2010-07-05 Thread Felipe Oriani
should have only one set of mappings ? who said that formula should be something different than pure SQL92 ? On Fri, Jul 2, 2010 at 5:59 PM, Felipe Oriani fbori...@gmail.com wrote: Yeah... I agree! I'd like that in the next version that could be added right =D On Fri, Jul 2, 2010 at 1:21 PM

Re: [nhusers] Re: Newbie: Creating an MVC app with NH as the ORM

2010-10-06 Thread Felipe Oriani
Thiago, take a look at this post http://ayende.com/Blog/archive/2009/08/16/what-is-the-cost-of-opening-a-session.aspx On Wed, Oct 6, 2010 at 2:13 PM, Thiago Alves thiago1...@gmail.com wrote: Jason, I do it as you suggested, but I have two questions: 1) Isn't it better to open the session

Re: [nhusers] Using SetResultTransformer(Transformers.AliasToBean() and SetCacheable

2010-10-20 Thread Felipe Oriani
Diego, Use Listobject[] and map DTO is more performative than SetResultTransformer ? On Wed, Oct 20, 2010 at 3:27 PM, Diego Mijelshon di...@mijelshon.com.arwrote: Workaround: instead of the ResultTransformer use Listobject[] and map the DTO using LINQ to objects .Select(x = new HouseDto{

[nhusers] SubQuery column (HQL)

2010-12-14 Thread Felipe Oriani
Hello Friends, I have a DTO in my project, something like this: public class ProductDto { public virtual int Id { get; set; } public virtual string Name { get; set; } /* get total of moving inventory to this product*/ public virtual int TotalInventory{ get; set; } } So, I did my hql

Re: [nhusers] Please,how to map a mysql TIME field?

2010-12-29 Thread Felipe Oriani
Julio, in your model you problably use Datetime right? Did you try to map this field with DateTime ? On Tue, Dec 28, 2010 at 7:11 PM, julio julioeama...@gmail.com wrote: Please,how to map a mysql TIME field? -- You received this message because you are subscribed to the Google Groups

[nhusers] Remove OrderBy from QueryOver

2012-05-22 Thread Felipe Oriani
Hello Guys, I have an extension method for my queries to page it, this is the code: public static PagedListT ToPageListT(this IQueryOverT, T query, int size, int index) { int total = query.Clone().FutureRowCount(); var list = query.Take(size).tSkip((index -

Re: [nhusers] Re: Remove OrderBy from QueryOver

2012-05-23 Thread Felipe Oriani
. The signature for order by can be taken from http://msdn.microsoft.com/en-us/library/bb341409 and this way you can apply it only on the list query. Expression (probably) has methods to combine the two expressions. On Wednesday, May 23, 2012 3:09:34 AM UTC+2, Felipe Oriani wrote: Hello Guys, I

Re: [nhusers] Re: Remove OrderBy from QueryOver

2012-05-23 Thread Felipe Oriani
danba...@gmail.com wrote: I always Clone the criteria to get the RowCount *before *applying the Ordering. -Dan On Wednesday, 23 May 2012 15:13:27 UTC+1, Felipe Oriani wrote: Yes, I don't want the nhibernate ordernig my count query. My code is something like this: public PagedListProduct

[nhusers] Dynamic where condition with QueryOver

2012-06-05 Thread Felipe Oriani
Hello guys, I have an application and I'm trying to implement DDD concepts. I have my repository class with some method to list entities. I would like to know how can I do a query with QueryOver to filter separating with 'AND' operator, when the parameter is filled, sample public

[nhusers] Left Join with QueryOver

2012-06-25 Thread Felipe Oriani
FieldInfo exists or not separated by Analyse (Analyse property). How can I create a QueryOver to get all fields and respective values (doing a left/right join) if the values do not exist? Thank you -- __ Felipe Oriani -- You received this message because you

Re: [nhusers] Could not resolve property (QueryOver with complex property)

2012-07-08 Thread Felipe Oriani
, Felipe Oriani felipeori...@gmail.comwrote: Hello guys, I have a asp.net mvc application with NHibernate and I do not know how to resolve a problem to query some data. I have this query: // create query var query = session.QueryOVerLaudo().Fetch(x = x.Equipament).Eager; // add some

Re: [nhusers] Could not resolve property (QueryOver with complex property)

2012-07-08 Thread Felipe Oriani
Thanks man, I found the solution using JoinAlias method :) Works great! []s On Sun, Jul 8, 2012 at 6:37 PM, Felipe Oriani felipeori...@gmail.comwrote: Hi Sadullah, thanks for the awser but I am new using nhibernate. Do you have sample of how to do this join? Thanks On Sun, Jul 8, 2012 at 6

[nhusers] IN operator with Linq or Create a SubQuery.

2012-07-16 Thread Felipe Oriani
Hello Guys, I have a linq query with NHibernate using Session.QueryT method and I in this query I Fetch some complex properties and collection properties. I would like to know, how cna I add an condition with IN operator from an int[] ? Look my code: public IEnumerableProduct GetProducts(int[]

Re: [nhusers] Re: IN operator with Linq or Create a SubQuery.

2012-07-17 Thread Felipe Oriani
)), but I find it is sometimes finicky about the type. I use Listint without a problem. Don On Monday, July 16, 2012 10:50:09 PM UTC-4, Felipe Oriani wrote: Hello Guys, I have a linq query with NHibernate using Session.QueryT method and I in this query I Fetch some complex properties

Re: [nhusers] Re: IN operator with Linq or Create a SubQuery.

2012-07-18 Thread Felipe Oriani
, July 17, 2012 9:52:37 AM UTC-4, Felipe Oriani wrote: Hi misterd429, I could convert int[] ni Listint without problem. THis way using .Contains(id) will generate a IN operator ? Thank you! On Tue, Jul 17, 2012 at 10:34 AM, mysterd429 wrote: Felipe, I'd do something like .Where(p

Re: [nhusers] Re: IN operator with Linq or Create a SubQuery.

2012-07-18 Thread Felipe Oriani
Hi NeoDarque, it works very fine, thank you so much man! Just one more question, look my final result (question in bold) var subQuery = Session.QueryOverLaudo() .Where(x = /* conditions here */) .OrderBy(x = x.Numero).Desc

Re: [nhusers] Re: IN operator with Linq or Create a SubQuery.

2012-07-19 Thread Felipe Oriani
Hi NeoDarque, Well, It's weird because it does not compile without the cast. And my subquery does not work too, it's a limitation of mysql. I tried to execute in a mysql client and I got the same message when I got MySqlException :( Well tank you anyway :) I will do two commands on database

[nhusers] Transactional Management in a Service Layer

2012-08-30 Thread Felipe Oriani
Hello guys, I have an application that will have some presentations layer (web, mobile, wpf, wcf, windows service to work on background etc...) and We are using NHibernate to persist the domain objects. We will have repositories (class library) to persist data, a service layer to use theses

[nhusers] Affected rows in write methods

2012-09-11 Thread Felipe Oriani
Hello guys, I would like to know, how can I get the affected rows when I call session's methods like Save, Delete, SaveOrUpdate, etc... as we got with ICommand.ExecuteNonQuery from Ado.Net? Is there any way to do this? I have a repository implementation and I would like to return this value, like

Re: [nhusers] Affected rows in write methods

2012-09-11 Thread Felipe Oriani
be nice to have this feature on the ORM tool. On Tue, Sep 11, 2012 at 10:21 AM, Oskar Berggren oskar.bergg...@gmail.comwrote: Are you trying to accomplish anything in particular? /Oskar 2012/9/11 Felipe Oriani felipeori...@gmail.com Hello guys, I would like to know, how can I get

[nhusers] PropertyValueException for Text Property

2012-11-01 Thread Felipe Oriani
Hello friends, I have a problem with NHibernate here, that I don't know how to resolve. I take a PropertyValueException exception, with a message: Error dehydrating property value for Domain.Product.Details I'm using Fluent NHibernate to map this property Details with a custom type (TEXT in Sql

[nhusers] Create Database Sql Server

2012-11-29 Thread Felipe Oriani
Hi friends, I would like to know if is there any way to nhbiernate create my database on the sql server? I know how to export my domain mapped with nhibernate into a database and generate tables, but the Catalog should exists. On that case, i don't have the catalog on the sql server, and I did

Re: [nhusers] Create Database Sql Server

2012-11-29 Thread Felipe Oriani
Thank you Øyvind On Thu, Nov 29, 2012 at 2:27 PM, Øyvind Valland oyvind.vall...@gmail.comwrote: This might be useful: http://stackoverflow.com/questions/914371/is-it-possible-to-create-a-database-using-nhibernate On 29 November 2012 16:49, Felipe Oriani felipeori...@gmail.com wrote: Hi

[nhusers] Multi SessionFactories

2013-02-05 Thread Felipe Oriani
Hi Friends, I have two databases: App DB: Schema for my Application. Log DB: Schema for Loging some entities. To create the log schema, I add a PreInsert/PreUpdate Listeners on SessionFactory of the App DB and I decide to look for changes and write on the Log DB. It works fine if both schemas

[nhusers] Mapping SaveUpdate Reference (HasOne)

2013-04-08 Thread Felipe Oriani
Hi, I am using Fluent NHibernate to map my entities on my project. I have a model that has a relation by one and the Id of this relation is on the main entity. For sample: public class Customer { public Address Address { get; set; } // address Id is on this table } public class Supplier {

Re: [nhusers] Mapping SaveUpdate Reference (HasOne)

2013-04-08 Thread Felipe Oriani
gunnar.lil...@gmail.comwrote: The mapping looks OK, so I think there's something more to the story. Either the mappings or some accidental replacing of the Address instance. /G 2013/4/8 Felipe Oriani felipeori...@gmail.com: Hi, I am using Fluent NHibernate to map my entities on my

[nhusers] Fill property of DTO with SubQuery

2013-04-10 Thread Felipe Oriani
Hi friends, I have a DTO object like this: public class TreeViewDTO { public string Value { get; set; } public string Text { get; set; } public bool HasChildren { get; set; } } and my entity mapped with Nhibernate is: public class Entity { public virtual int Id { get; set; }

[nhusers] Checking related entities before delete

2013-05-14 Thread Felipe Oriani
Hi guys, I have a model with some relations mapped with nhibernate and it is working fine, for sample: public class A { public int Id { get; set; } // other properties public ICollectionB BList { get; set; } public ICollectionC CList { get; set; } public ICollectionD DList { get;

[nhusers] Get reference property name of related entity

2013-05-29 Thread Felipe Oriani
Hi friends, I have been developing an application using nhibernate. I have my repository and I need to create a SafeDelete method to avoid cascade operations. The users want to see what entities has related data to check when delete and avoid cascades. I'm trying to implement a generic solution

[nhusers] Mapping ID for Sql Server Identity and Oracle Sequence

2013-06-20 Thread Felipe Oriani
Hi guys, I have a application that will support SQL Server 2008, SQL Server 2012 and Oracle. I have been using fluent nhibernate to map my entities with Nhibernate and I have some questions about how should I map the ID. Oracle supports only the Sequence, SQL Server 2008 only identity and Sql

[nhusers] Save a Child for a existent Parent

2013-07-18 Thread Felipe Oriani
Hello guys, I have a model with some inherits and it is using nhibernate to persisti on a Database. The nhibernate mapping with fluent nhibernate is working fine, but I have a scenario where I need to save a child for a existent parent. My model looks like this: public class Item{ public long

[nhusers] How do I perform an accent insensitive compare in Linq to Nhibernate?

2013-08-29 Thread Felipe Oriani
Hello guys, I have a software and my users will use it with portuguese language. In this language we have accenttuation in some characteres, for sample: à, á, é, í, ã, etc... Is there any way to create a Linq Query to ignore it when I do some filters? session.QueryCustomer().Where(c =

[nhusers] Change Property of a Command

2013-09-25 Thread Felipe Oriani
Hello friends, I have a problem with nhibernate. I have a Oracle database and in a table of this database, I have a column of Long type (to store large strings). I cannot change the type because other systems use it as long type. Everytime I try to access this column, I get the empty string and

[nhusers] Re: Change Property of a Command

2013-09-25 Thread Felipe Oriani
= -1; } } And add this class on the connection.driver_class in the hibernate.cfg.xml. Thank you anyway. On Wed, Sep 25, 2013 at 11:54 AM, Felipe Oriani felipeori...@gmail.comwrote: Hello friends, I have a problem with nhibernate. I have a Oracle database and in a table

[nhusers] Does Take method execute query?

2013-12-23 Thread Felipe Oriani
Hi friends. I have a query like this: - var query = session.QueryEntity().Take(100); if (condition) { query = query.Where(x = x.Name.StartWith(A)); } var result = query.ToList(); - I would like to know, if in the queryable Take method execute my query

Re: [nhusers] Does Take method execute query?

2013-12-26 Thread Felipe Oriani
that.g -- Allan Ferreira .NET Software Architect .NET Senior Consultant M: +55-41-98098597 E: allanfag...@gmail.com On Mon, Dec 23, 2013 at 3:35 PM, Felipe Oriani felipeori...@gmail.comwrote: Hi friends. I have a query like this: - var query = session.QueryEntity

[nhusers] System.TypeInitializationException on sessionFactory

2014-02-20 Thread Felipe Oriani
Hi friends, I'm creating a project with NHibernate in Windows Forms. It was working fine but I update the reference of nhibernate to 3.3.1 and fluent nhibernate to 1.4 and I get a error with a message: *An unhandled exception of type 'System.TypeInitializationException' occurred in

[nhusers] Re: System.TypeInitializationException on sessionFactory

2014-02-20 Thread Felipe Oriani
I found the problem, my app.config was wrong (hierarchy of nodes) and I do not know why nhibernate says the loggerProvider was not configured, it work back. Thanks On Thu, Feb 20, 2014 at 1:14 PM, Felipe Oriani felipeori...@gmail.comwrote: Hi friends, I'm creating a project with NHibernate

Re: [nhusers] Get Meta Data from Database table name and column

2015-05-20 Thread Felipe Oriani
at 7:25:38 AM UTC+1, Rippo wrote: Quick question what is difference between? CreateQuery and CreateSQLQuery Many Thanks Richard *From:* nhu...@googlegroups.com [mailto:nhu...@googlegroups.com] *On Behalf Of *Felipe Oriani *Sent:* 19 May 2015 23:31 *To:* nhu...@googlegroups.com

Re: [nhusers] Re: CreateSQLQuery is closing the connection inside NHibernate

2015-06-11 Thread Felipe Oriani
Olá Ricardo, I've found the problem. I create an IoC container to resolve the custom type in the CodeDom. I was registering the connection in the container and when the container was being disposing, it was disposing my connection. (omg haha). And yes, I will create an unit test to make sure

Re: [nhusers] Re: CreateSQLQuery is closing the connection inside NHibernate

2015-06-11 Thread Felipe Oriani
is CloseConnection. Are you sure it isn't being used? RP On Wednesday, June 10, 2015 at 10:06:36 PM UTC+1, Felipe Oriani wrote: Hi Ricardo, I will give you more detail about my problem. In the Configuration to generate ISessionFactory (with FluentNH) we set the CurrentSessionContextClass

Re: [nhusers] Re: CreateSQLQuery is closing the connection inside NHibernate

2015-06-10 Thread Felipe Oriani
current state is closed. Thank you On Wed, Jun 10, 2015 at 5:32 PM, Ricardo Peres rjpe...@gmail.com wrote: How are you obtaining the ISession in the first place, and how are you binding it to the ISessionFactory? RP On Wednesday, June 10, 2015 at 8:37:24 PM UTC+1, Felipe Oriani wrote: Hi

[nhusers] Get Meta Data from Database table name and column

2015-05-19 Thread Felipe Oriani
Hi all, I have a method which receives tree parameters that holds a table name and two columns. I would like to hit an HQL command using this information to create an list as a result. I know how to deal with HQL but I would like to know, how can I get the entity name and properties from these

[nhusers] Concat two entity properties and set into an DTO property

2015-08-19 Thread Felipe Oriani
Hello guys, I have an query (QueryOverT, T) with NHibernate and I would like to concat two entity properties (for sample: FirstName + space + LastName) into a single property (FullName) on my DTO (like as alias...). I have this method it: public static IProjection Concat(IProjection[]

Re: [nhusers] Insert and Update on the same record and transaction.

2015-12-04 Thread Felipe Oriani
that > only commands belonging to a specific transaction are executed? > > 2015-12-04 21:06 GMT+01:00 Maximilian Haru Raditya <m4h...@gmail.com>: > >> Would session.Flush() between session.Save() and >> session.Connection.CreateCommand() work out for you? >> On

Re: [nhusers] Re: Insert and Update on the same record and transaction.

2015-12-04 Thread Felipe Oriani
IDbCommands and execute in order. It forces the commands to execute before commit which is what we need. It was the solution we have found today. Thank you guys! Att, On Fri, Dec 4, 2015 at 2:44 PM, <stuart.mo...@spektrix.com> wrote: > On Thursday, 3 December 2015 19:56:17 UTC, Felipe Ori

[nhusers] Insert and Update on the same record and transaction.

2015-12-03 Thread Felipe Oriani
Hello guys, I have a problem using NHibernate, but first let me explain the scenario. We have a web application which allows the user to manage fields over the entities. For sample, we have a City table with fixed columns (Id, Name and State), then user can define new columns on the entity (city)

Re: [nhusers] How escape column names?

2016-06-21 Thread Felipe Oriani
tick - NH will translate to > suitable character for DB dialect. > > 2016-06-21 15:10 GMT+01:00 Felipe Oriani <felipeori...@gmail.com>: > >> Hello guys, >> >> I've developing a project with NHibernate and Oracle. We have a table >> which has a column named Level

[nhusers] How escape column names?

2016-06-21 Thread Felipe Oriani
Hello guys, I've developing a project with NHibernate and Oracle. We have a table which has a column named Level and Level is a keyword used on oracle, which we should escape with quotes to make a sql statement. I've looking how to do it on NHibernate and I saw we have a configuration that we can

Re: [nhusers] How escape column names?

2016-06-21 Thread Felipe Oriani
com> wrote: > The dialect specific quite character that NH will apply for you is found > in the source code of each dialect. > > 2016-06-21 15:45 GMT+01:00 Felipe Oriani <felipeori...@gmail.com>: > >> Yes, I'm using Fluent NH to map, but to configure I have th

Re: [nhusers] Re: Query runs only once, then throws InvalidCastException on CodeDom

2016-02-05 Thread Felipe Oriani
g? Is this enabled? 2nd level cache? > > Did you try to execute Select before Order? > > You are using the latest Nhibernate 4.0.4? > > best regards, > Peter > > > Am Mittwoch, 3. Februar 2016 13:48:00 UTC+1 schrieb Felipe Oriani: > >> Hello guys! >

Re: [nhusers] Query runs only once, then throws InvalidCastException on CodeDom

2016-02-12 Thread Felipe Oriani
We will try to create a repository on github to share a scenario like this and we will back to post here. On Thu, Feb 11, 2016 at 10:06 PM, Alexander Zaytsev <haz...@gmail.com> wrote: > I don't know. Trying to understand what's happening. > > > On Friday, 12 February 2

Re: [nhusers] Query runs only once, then throws InvalidCastException on CodeDom

2016-02-12 Thread Felipe Oriani
the error. If we change the query, we got the same error, but just with anonymous objects defined by Select method. If we just use a ToList() it works fine. See the code on this repository: https://github.com/felipeoriani/nh-bug Thank you. On Fri, Feb 12, 2016 at 8:36 AM, Felipe Oriani

Re: [nhusers] Re: Query runs only once, then throws InvalidCastException on CodeDom

2016-02-11 Thread Felipe Oriani
per that caches > results sets for a limited time. > > best regards, > Peter > > Am Freitag, 5. Februar 2016 17:09:11 UTC+1 schrieb Felipe Oriani: >> >> Hi PeSo, thanks for the answer >> >> We tried to execute a simple query without order and it fails. T

Re: [nhusers] Re: Query runs only once, then throws InvalidCastException on CodeDom

2016-02-11 Thread Felipe Oriani
pens only when query does not return any results, right? > > Best Regards, > Alexander > > On Fri, Feb 12, 2016 at 1:01 AM, Felipe Oriani <felipeori...@gmail.com> > wrote: > >> Hi PeSo and Alexander >> >> Just to remember you guys, the query executes fi

[nhusers] Query runs only once, then throws InvalidCastException on CodeDom

2016-02-03 Thread Felipe Oriani
Hello guys! We have a web application which has some methods defined by user and executed by Codedom (CSharpCodeProvider) between our code. Our customer has programmers that can adpts business rules over the project and execute some queries on the scope of execution. We have a simple query like

[nhusers] Add where condition on collection child property and project the select

2016-08-02 Thread Felipe Oriani
Hi all, We have a project where the default method to query on the database is using QueryOver. I would like to know how can we add a "where" filter over a child collection and project if there is a record on it. Using linq, we usually do something like this: var query = from e in

Re: [nhusers] NHibernate 4.1.1.GA released

2017-02-01 Thread Felipe Oriani
Nice job Alexander. Thank you for sharing it. I would like to ask if is there plans to implement a .net core version? On Wed, Feb 1, 2017 at 11:00 PM, Alexander Zaytsev wrote: > NHibernate 4.1.1 is now released. > > For a list of resolved issues, see the release notes: >

Re: [nhusers] Re: Nhibernate Paging Time Bomb

2017-02-23 Thread Felipe Oriani
What is the best approach to solve a page like this (millions and millions records)? On Thu, Feb 23, 2017 at 2:20 PM, Ricardo Peres wrote: > Why would you want to page over 1 trillion records? > > RP > > > On Thursday, February 23, 2017 at 11:35:40 AM UTC, Laurel Jay Fadul

Re: [nhusers] Re: Nhibernate Paging Time Bomb

2017-02-24 Thread Felipe Oriani
you guys! On Thu, Feb 23, 2017 at 6:47 PM, Gunnar Liljas <gunnar.lil...@gmail.com> wrote: > What is the desired result? Paging through millions (trillions!) of > records doesn't make much sense. > > /G > > 2017-02-23 22:01 GMT+01:00 Felipe Oriani <felipeori...@gmail.

Re: [nhusers] Re: Inner Join with a subquery (QueryOver)

2017-02-15 Thread Felipe Oriani
log/2014/10/24/queryover-series-part-8-working-with-subqueries/> > > If my team has to make nested subqueries we define a database view and > then create a model that maps to the view. > > > On Monday, February 13, 2017 at 12:29:58 PM UTC-5, Felipe Oriani wrote: >> >&

[nhusers] Inner Join with a subquery (QueryOver)

2017-02-13 Thread Felipe Oriani
Hello guys, We are migrating a legancy system to .Net and we use NHibernate on the Data Access Layer. I would like to know, how can we do a inner join with a subquery with QueryOver? For sample: select wo.id, wo.description, op.total from work_order wo *inner join (select

[nhusers] Mapping Guid Id on Oracle

2016-12-23 Thread Felipe Oriani
Hi guys, We have a table on the database where we want to map the ID as Guid. Our project should run over two databases, Sql Server and Oracle. For Sql Server, we define the column type as *uniqueidentifier* and it works fine. For Oracle, we try to define it as char(36), raw(36), varchar2(36) but

Re: [nhusers] Re: Mapping Guid Id on Oracle

2016-12-23 Thread Felipe Oriani
il.com> wrote: > In Oracle, a GUID is defined as RAW(16). > > RP > > On Friday, December 23, 2016 at 12:22:24 PM UTC, Felipe Oriani wrote: >> >> Hi guys, >> >> We have a table on the database where we want to map the ID as Guid. Our >> project should run

Re: [nhusers] Re: Mapping Guid Id on Oracle

2016-12-23 Thread Felipe Oriani
PM, Fran Knebels <fkneb...@gmail.com> wrote: > Richardo is correct. I've used RAW(16) before for Guid's in Oracle. > > Easy way to verify is to generate the schema from your mappings. > > On Fri, Dec 23, 2016 at 11:19 AM, Felipe Oriani <felipeori...@gmail.com> > wr

Re: [nhusers] Re: Mapping Guid Id on Oracle

2016-12-23 Thread Felipe Oriani
users? > > I'm using mapping by code. this code is equivalent to yours > > Id(x => x.Id, map =>{ > map.Column("Id");map.Generator(Generators.GuidComb); > }); > > > > On Fri, Dec 23, 2016 at

Re: [nhusers] Re: Mapping Guid Id on Oracle

2016-12-23 Thread Felipe Oriani
koverflow thread. > There's a coversion routine to take it from the raw format to the .net > > On Dec 23, 2016 11:51 AM, "Felipe Oriani" <felipeori...@gmail.com> wrote: > >> Hi Fran, >> >> On our Entity we define the ID (PK) as Guid and we have FKs

Re: [nhusers] Avoid Joins or SELECT N+1 problem

2017-03-15 Thread Felipe Oriani
Hey guys, I am looking at the problem for "select n+1" queries. It scare us when I a session with more than 10 queries more than 100 in some cases haha). Some refactoring to do. Sometimes I just need a string property to fill a column on the grid and using `Fetch` extension method NHibernate fill

Re: [nhusers] Avoid Joins or SELECT N+1 problem

2017-03-15 Thread Felipe Oriani
ry.name/> >> }).ToList(); >> >> >> >> On Wednesday, March 15, 2017 at 12:35:16 PM UTC, Felipe Oriani wrote: >>> >>> Hey guys, I am looking at the problem for "select n+1" queries. It scare >>> us when I a session with mo

[nhusers] Take 10 when using FetchMany

2017-03-22 Thread Felipe Oriani
Hello Guys, I have been using NHibernate on my project and I have a question here related with FetchMany and Take. We are using Linq to make the queries. We are using Oracle database and we are trying to perform this linq query: var result = Session.Query() .FetchMany(x =>

Re: [nhusers] Avoid Joins or SELECT N+1 problem

2017-03-15 Thread Felipe Oriani
ion. Is it the default behaviour? Or is there any way to tell to linq when use *LEFT *or *INNER* join? I know in QueryOver we can use Left / Inner / Right, but we have complex queries with Linq. Thank you. On Wed, Mar 15, 2017 at 1:41 PM, Felipe Oriani <felipeori...@gmail.com> wrote:

Re: [nhusers] Avoid Joins or SELECT N+1 problem

2017-03-15 Thread Felipe Oriani
/ThenInnerFetch methods. Would be great to have these methods on the next version of NHibernate. The Fetch just generates the Left join. Thank you. On Wed, Mar 15, 2017 at 3:07 PM, Felipe Oriani <felipeori...@gmail.com> wrote: > Guys, just a last question about nhibernate querying/fetching. > &

Re: [nhusers] Re: How count data without subquery

2017-03-02 Thread Felipe Oriani
Q? > Have you tried Criteria API? > > RP > > > On Thursday, March 2, 2017 at 3:20:38 PM UTC, Felipe Oriani wrote: > >> Hello guys, >> >> We have been using NHibernate in a project with Oracle database. We have >> a count query that nhibernate is not ret

Re: [nhusers] Re: How count data without subquery

2017-03-02 Thread Felipe Oriani
Ricardo, consider this code for countQuery. I'm using `Take` method: var total = countQuery.Select(Projections.RowCountInt64()) .Take(250) .FutureValue() .Value; On Thu, Mar 2, 2017 at 1:47 PM, Felipe Oriani <felipe

[nhusers] Avoid Joins or SELECT N+1 problem

2017-03-14 Thread Felipe Oriani
Hello guys, I am using the NHProf to trace my queries and check possibles issues and improve it. The NHProf has some alerts that it is built in the tool as a suggestion to improve your statements. I have a scenario where we have the problem to "select n+1", where the code was executing something

Re: [nhusers] Re: How count data without subquery

2017-03-02 Thread Felipe Oriani
I have tried using Criteria API and I hava the same result. On Thu, Mar 2, 2017 at 1:52 PM, Felipe Oriani <felipeori...@gmail.com> wrote: > Ricardo, consider this code for countQuery. I'm using `Take` method: > > var total = countQuery.Select(Projection

[nhusers] How count data without subquery

2017-03-02 Thread Felipe Oriani
Hello guys, We have been using NHibernate in a project with Oracle database. We have a count query that nhibernate is not returning what we want. The query result: select y0_ from ( SELECT count( *) as y0_ FROM Table1 this_ inner join where ) where rownum <=250 /*

Re: [nhusers] Open Stateless session given a session

2017-07-07 Thread Felipe Oriani
gnificantly faster than trying to wrangle this > through NHibernate > > On Jul 7, 2017 1:09 PM, "Felipe Oriani" <felipeori...@gmail.com> wrote: > >> Hi Gunnar, >> >> I am using Oracle but it also can run over MsSql. >> >> I am sorry, I express mys

Re: [nhusers] Open Stateless session given a session

2017-07-07 Thread Felipe Oriani
transaction? Thank you. On Fri, Jul 7, 2017 at 12:24 PM, Gunnar Liljas <gunnar.lil...@gmail.com> wrote: > 20 is a lot, even for a stateless session. Are you using MSSQL? > > /G > > 2017-07-07 16:22 GMT+02:00 Felipe Oriani <felipeori...@gmail.com>: > >&g

Re: [nhusers] Re: NHibernate 5.0 released

2017-10-13 Thread Felipe Oriani
Great job guys. Congrats to all envolved. I was thinking the version 5.0 of NHibernate would offer support for .Net Core. Is there any blocks to provide this support? Thank you. On Wed, Oct 11, 2017 at 8:14 PM, Gunnar Liljas wrote: > Any particular areas we

Re: [nhusers] Re: NHibernate 5.0 released

2017-11-07 Thread Felipe Oriani
Fluent NHibernate has conventions . I agree with Ricardo, the sintaxe of FNH is nice and it would be nice if it could be part of NHibernate in the next major versions :D On Tue, Nov 7, 2017 at 10:40 AM, Ricardo Peres

[nhusers] How persist euro symbol in oracle database with NH

2017-12-07 Thread Felipe Oriani
Hi, We have a database which we store the currencies of the world. We have a column called Symbol which the datatype is VARCHAR(20). It is a Oracle database and we are mapping in a string property with Fluent NHibernate like this: Map(x => x.Symbol).Not.Nullable(); In this column we store the

Re: [nhusers] How persist euro symbol in oracle database with NH

2017-12-07 Thread Felipe Oriani
fine. Thank you. On Thu, Dec 7, 2017 at 2:14 PM, Fran Knebels <fkneb...@gmail.com> wrote: > Aren't those symbols Unicode? You would need to store them in an nvarchar > column. > > Conversely , you could store the html value in the column which would be > ASCII > > On De

Re: [nhusers] NHibernate 5 and mapping by code

2018-02-06 Thread Felipe Oriani
Does anybody here tested nhibernate 5.0 with fluent nhibernate? On Mon, Feb 5, 2018 at 7:36 PM, Rein Verberne wrote: > Yes it is supported and works very well. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To

[nhusers] NHibernate with Oracle and nls_lang

2018-03-27 Thread Felipe Oriani
Hey guys, We have an application using NHibernate with Oracle 11g and configured to use the Oracle Managed DataAccess provider. It works fine in a lot fo environtments, but in a single enrivonment, we are having problems with NLS_LANG configuration and every query that extract information from

Re: [nhusers] why does nHibernate has so many querying apis?

2018-04-02 Thread Felipe Oriani
I think it is important to know all APIS and know how to choose each one on the best scenario. For sample, I think LINQ is more productive for trivials queries, it i easy to write and works fine (improving the linq support and getting better on each new version of NH). For dynamic queries,

[nhusers] Exception of same identifier in a new session

2019-01-10 Thread Felipe Oriani
Hey guys, I have a scenario where we are running a code that consume some processing time. This progress of this process need to be updated on the database. Let me show some code to make a better explanation. Our method that update the progress on the database look like this: void

Re: [nhusers] Fetch multiple collections

2019-02-01 Thread Felipe Oriani
Can you post your mapping? Another quick tip, try to use generic collections: ICollection Books { get; set; } ICollection Articles { get; set; } On Fri, Feb 1, 2019 at 12:35 AM Kavitha wrote: > I am using Nhibernate version 3.2.0 I need to fetch multiple collections. > > public class

[nhusers] Add OR condition on a existent QueryOver

2019-08-22 Thread Felipe Oriani
Hey guys, I have a QueryOver where can have filters defined. This QueryOver is build for a grid component and when I get it, I would like to be able to add a restriction (separated by OR from the current filters). I tried it: var queryOver = GetQueryOver(); // it add a my condition, but

[nhusers] Session per Request in ASP.NET Core

2019-11-14 Thread Felipe Oriani
Hi everyone. I have been working with NHibernate since the 2.x.x and I always use the ORM with the a Session/Transaction per Request with Asp.Net on .Net Framework. It always worked very well on production with a lot of users. Now, I am starting a new project with ASP.NET Core and I do not have

Re: [nhusers] Static Coding Practices

2020-01-17 Thread Felipe Oriani
Well, I am not sure if what I am going to suggest is what you are looking for but take a look at a book called NHibernate Cook Book. There are some good pratices with NHibernate and how to deal with it in different scenarios like asp.net, windows forms, etc. About the security, I would like to

[nhusers] NH Documentation

2020-10-05 Thread Felipe Oriani
Hi everyone. I would like to know if is there any link where I can find the documentation for all the improvements of the versions of NHibernate 5.x.x? Is there some official docs? I want to know some good pratices for .Net Core and NHibernate and maybe upgrade a project from Fluent NH to

[nhusers] How ignore Time in Between filter operation

2020-06-04 Thread Felipe Oriani
Hi everyone! I have a project build with NHibernate and MySql. In this project I have query built using QueryOver and I would like to know how to ignore the time when I filter it using the "between" operator, for sample: query = query.AndRestrictionOn(x =>

Re: [nhusers] Nhibernate "Pooled connection request timed out" error

2021-01-18 Thread Felipe Oriani
Hey @Hakan and guys I'm sorry, I know it is almost an old thread, but, just to be sure you have tried something I want to suggest. We have a project where the requirements is to perform over the SQL Server and Oracle depending of what license the customer has. I had some issues with pool of

  1   2   >