[nhusers] Re: Date Format Problem

2009-10-27 Thread Hiren
I want remove time part and display only date in dd/MM/ format On Oct 24, 7:19 am, Diego Mijelshon wrote: > Hiren, > > After getting the data, use the DateTime.Date property (it returns a > DateTime with 00:00:00 as the time) > >    Diego > > > > On Fri, Oct 23, 2009 at 02:13, Hiren wrote:

[nhusers] Re: Date Format Problem

2009-10-27 Thread Hiren
at the time of query upload, query is returning rows with date field along with time, I want to remove time part and display only date in dd/MM/ format. On Oct 24, 7:29 am, Fabio Maulo wrote: > only in query upload or even when you save the obj ? > > 2009/10/23 Hiren > > > > > Dear Friends,

[nhusers] Re: is nested joined-subclass supported?

2009-10-27 Thread Fabio Maulo
obviously supported in NH or we can close the shop. 2009/10/27 kasvis...@gmail.com > > Hi, > > Is nested joined-subclass supported in Nhibernate. > > If yes how do i go about implementing it using Fluent Nhibernate. > > public class Animal > { >public virtual int Id { get; set; } >public

[nhusers] Re: Set to null FK

2009-10-27 Thread Fabio Maulo
where is the parent-child mapping ? 2009/10/27 jaspion > > Hello, > > I have a many to one relationship where the key allows nulls, > in NHibernate, when I try to update a child that was filled with the > null value, the generated query put the old value in the child rather > than the null valu

[nhusers] Re: getting the parent and number of child entities

2009-10-27 Thread Fabio Maulo
select p, size(p.Children) from Parent p 2009/10/27 Michal Drozd [toper] > > Hi , > > I try to execute the query that pulls a list of parents and the number > of corresponding child elements. > In T-SQL I would write it like this: > > select p.*, isnull(c.cnt, 0) > from parent p > left join (se

[nhusers] Re: Event Listener prior to session SaveOrUpdate()

2009-10-27 Thread Fabio Maulo
IFlushEntityEventListener inherit from DefaultFlushEntityEventListener override DirtyCheck make your work and call base.DirtyCheck where needed 2009/10/27 Matt Mangold > > Is there an NHibernate Event listener interface that I can register so > that I am notified prior to SaveOrUpdate() regardle

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
Have you a link to pros and con of set all parameters size always for any DbType ? I don't remind why we have that "if" there... probably was for the bug I have entirely analysed and fixed (about the management of size/precision,scale) but perhaps is because somebody have analysed some other situa

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Daniel Auger
Fabio, I totally understand your frustration with this quirk of SQL Server. However I tend to agree with Rob. If NHibernate can work around it without compromising the framework (i.e. the workaround is isolated to the driver), the workaround should probably be implemented if only to help adoption

[nhusers] Linq to NHibernate and date function

2009-10-27 Thread Fabio Margarito
Hi all, I trying to do the follow query using Linq to NHibernate. The question is, is it possible? var client = from query in sessao.Linq() where query.DataVencimento.Day == DateTime.Now.Day select query; and i get de error NHibernate.QueryException: could not resolve property: DataVencim

[nhusers] Re: Automatically create database if it does not exist

2009-10-27 Thread Dmitiry Nagirnyak
> > Yes, of course, But you do that through the settings you define at > nhibernate configuration which stores your credentials to access to explicit > database, not the server database. > > And I can use those credentials to create database. And yes, the credentials do need privileges for that.

[nhusers] Re: Getting a progress status of long operations

2009-10-27 Thread Vadgros
Hey. I think I don't explain myself too well. If I'm saving the children as you proposed var children = session.get(id).Children; foreach(var child in children) { Change(child); } I don't need NH events at all. I simply fire an event each time I perform a save (or each K times). This is

[nhusers] Event Listener prior to session SaveOrUpdate()

2009-10-27 Thread Matt Mangold
Is there an NHibernate Event listener interface that I can register so that I am notified prior to SaveOrUpdate() regardless if the entity is dirty or not? I used the ISaveOrUpdate Event listener, but it only fires if the entity is dirty. I would like to be able to trap the event prior to the di

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
sorry for the relief... sorry 2009/10/27 Fabio Maulo > and Rob... > my goal is do the right thing in the right place. > We all should learn how send issues to MsSQL team and not only looking for > a workaround in NHibernate. > Do you have a link to the issue regarding the query-execution plan in

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
and Rob... my goal is do the right thing in the right place. We all should learn how send issues to MsSQL team and not only looking for a workaround in NHibernate. Do you have a link to the issue regarding the query-execution plan in MsSQL ? do you know why MsSQL need the parameter-size to choose

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
for that reason we are giving you the opportunity to define what NH should do to work around a MsSQL issue. 1. Create you own IDriver inheriting from SqlClientDriver 2. then override GenerateCommand with this implementation { IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes

[nhusers] getting the parent and number of child entities

2009-10-27 Thread Michal Drozd [toper]
Hi , I try to execute the query that pulls a list of parents and the number of corresponding child elements. In T-SQL I would write it like this: select p.*, isnull(c.cnt, 0) from parent p left join (select parentid, count(childid) as cnt from children group by parentid) c on p.id = c.parentid

[nhusers] Linq and lazy/eager loading

2009-10-27 Thread CSLem
I am using NHibernate Linq for a project in which one requirement is to start with a large collection (approx. 2500 objects). The object in the collection contains two collections - one of which could be fairly significant for each object. As a result, I don't want to eager load the collections. I

[nhusers] Set to null FK

2009-10-27 Thread jaspion
Hello, I have a many to one relationship where the key allows nulls, in NHibernate, when I try to update a child that was filled with the null value, the generated query put the old value in the child rather than the null value. My mappings:

[nhusers] Map subclass with multiple interfaces

2009-10-27 Thread jamesjbigler
I am new to NHibernate. I have read NHibernate in Action and I have spent several days searching through forums and blog posts, but I can't figure out how to map the model below. If someone could help me figure this out I would greatly appreciate it. (I used fluent mappings below but if you rath

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Rob
Although I agree with your sentiment from an architectural perspective (i.e., "ORM is to fill the gap between O and RDMS and not to fix RDBMS issues"), as a practical matter (if NH adoption is your goal), providing the user with a(n easy) way to overcome "issues" is often required by the thing fil

[nhusers] Re: HQL and UNION ALL

2009-10-27 Thread Fabio Maulo
which is the problem ? Have you tried something about what you are saying in your first post ? or you a looking for the custom dialect and the HQL ? or only the HQL ? if you are looking for the HQL which is the domain to query ? Can you spent 5 minutes and re-read your question ? 2009/10/27 Jimit

[nhusers] Re: QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Fabio Maulo
you are welcome! 2009/10/27 Bobby Johnson > thank you for the help. > > > On Tue, Oct 27, 2009 at 10:23 AM, Fabio Maulo wrote: > >> What? >> >> >> 2009/10/27 Bobby Johnson >> >>> Thanks, Fabio. Your a peach! >>> >>> On Tue, Oct 27, 2009 at 9:08 AM, Fabio Maulo wrote: >>> select distinct c

[nhusers] Re: HQL and UNION ALL

2009-10-27 Thread Jimit
Does anyone at all have an answer? On Oct 15, 2:04 pm, Jimit Ndiaye wrote: > Hiall, > I've been doing a bit of googling but I can't seem to find a   > definitive answer on whether or not HQL currently supports > theUNION ALLkeyword. I've found a few dated articles saying everything from   > not

[nhusers] Re: QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Bobby Johnson
thank you for the help. On Tue, Oct 27, 2009 at 10:23 AM, Fabio Maulo wrote: > What? > > > 2009/10/27 Bobby Johnson > >> Thanks, Fabio. Your a peach! >> >> On Tue, Oct 27, 2009 at 9:08 AM, Fabio Maulo wrote: >> >>> select distinct c from Customer c , elements(c.Orders) o where >>> o.OrderDate >

[nhusers] Re: QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Fabio Maulo
What? 2009/10/27 Bobby Johnson > Thanks, Fabio. Your a peach! > > On Tue, Oct 27, 2009 at 9:08 AM, Fabio Maulo wrote: > >> select distinct c from Customer c , elements(c.Orders) o where o.OrderDate >> > :orderDate >> >> The BR is reported in releasenotes.txt >> >> 2009/10/27 Bobby Johnson >> >

[nhusers] Re: QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Bobby Johnson
Thanks, Fabio. Your a peach! On Tue, Oct 27, 2009 at 9:08 AM, Fabio Maulo wrote: > select distinct c from Customer c , elements(c.Orders) o where o.OrderDate > > :orderDate > > The BR is reported in releasenotes.txt > > 2009/10/27 Bobby Johnson > > Hi all, >> >> I am upgrading an application th

[nhusers] Re: QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Fabio Maulo
select distinct c from Customer c , elements(c.Orders) o where o.OrderDate > :orderDate The BR is reported in releasenotes.txt 2009/10/27 Bobby Johnson > Hi all, > > I am upgrading an application that has a handful of HQL queries. I have > been able to solve all of my errors with exception to t

[nhusers] QuerySyntaxException when upgrading to 2.1.0GA

2009-10-27 Thread Bobby Johnson
Hi all, I am upgrading an application that has a handful of HQL queries. I have been able to solve all of my errors with exception to this one. Here is the query: select distinct c from Customer c , c.Orders.elements o where o.OrderDate > :orderDate and the error: error: NHibernate.Hql.Ast.AN

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Daniel Auger
Understood Fabio :) On Oct 27, 9:55 am, Fabio Maulo wrote: > To be more clearhttp://twitter.com/fabiomaulo/status/5186045199 > > 2009/10/27 Fabio Maulo > > > > > if so... remember that the Driver, in NHibernate, is an injectable > > component. > > You can copy&paste the default impl. and then c

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
To be more clear http://twitter.com/fabiomaulo/status/5186045199 2009/10/27 Fabio Maulo > if so... remember that the Driver, in NHibernate, is an injectable > component. > You can copy&paste the default impl. and then change it to do what you > want; after that you only need to use the NH's conf

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Fabio Maulo
if so... remember that the Driver, in NHibernate, is an injectable component. You can copy&paste the default impl. and then change it to do what you want; after that you only need to use the NH's configuration to inject your drive. 2009/10/27 Daniel Auger > > The blog author posted a comment on

[nhusers] is nested joined-subclass supported?

2009-10-27 Thread kasvis...@gmail.com
Hi, Is nested joined-subclass supported in Nhibernate. If yes how do i go about implementing it using Fluent Nhibernate. public class Animal { public virtual int Id { get; set; } public virtual string Name { get; set; } } public class Cat : Animal { public virtual int WhiskerLength

[nhusers] Re: Sql Server Executions Plans Still Not Working with prepare_sql = true?

2009-10-27 Thread Daniel Auger
The blog author posted a comment on the blog indicating that the team was using NHibernate 2.1.0 with MSSQL Server 2005. I will try to test 2.1.1 when time allows. Fabio, do the fixes you made negate the need for setting prepare_sql = true? The reason why I ask is that if I'm understanding the bl

[nhusers] Re: about session per-request implementation

2009-10-27 Thread Jason Meckley
you can still use session per request with webforms. Instead of an MVC framework, use an MVP model instead. you can still intercept the presenter calls to manage transactions. If you are familiar with Rhino and Castle you can use Rhino.Igloo as your MVP framework. At a minimum you can grok the co

[nhusers] Re: about session per-request implementation

2009-10-27 Thread Jason Dentler
It's a hack, but this is WebForms anyway so use the request events on Global.asax to manage your sessions. Sessions are pretty lightweight, so creating them when they're not necessary isn't the end of the world in most cases. I prefer to manage my transactions explicitly, but the choice is up to y

[nhusers] Re: Getting a progress status of long operations

2009-10-27 Thread Jason Meckley
what's not to like about NH events this is exactly what you are looking for. if you are updating a collection from an aggregate than the model described above will work. You are going from the data access layer to the UI. there is no magic object to do that automatically. you will need to wire th

[nhusers] Oracle and Booleans

2009-10-27 Thread srf
Im know that oracle doesnt have a boolean type but nhibernate creates a number(1) column type to store a 1 or 0 but nhibernate puts true or false into the oracle DbParameter. Somewhere down the line though this true/false gets converted to 1 or 0 by the driver and inserts a number. This works fine

[nhusers] Re: Automatically create database if it does not exist

2009-10-27 Thread José F . Romaniello
I don't agree with @JoséASalvador (my namesake), test in a real world database. On the other hand, you are right.. but I used to create the database manually. What next? Do you want to write some code to install a unit testing instance of the engine? Also, if you want to run unit tests in a conti

[nhusers] Re: about session per-request implementation

2009-10-27 Thread kor
thanks but the site is made by old asp.net pages, i cannot change to mvc framework --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsu

[nhusers] Re: about session per-request implementation

2009-10-27 Thread Jason Meckley
using session per request in an MVC model I intercept the method call on the controller and wrap this in a transaction. you can either roll your own interceptor or use Castle's ATM module [Transactional] class MyController { [Transaction] public void Index() { this wil

[nhusers] Re: Automatically create database if it does not exist

2009-10-27 Thread A. Salvador Vanaclocha
El mar, 27-10-2009 a las 23:27 +1100, Dmitiry Nagirnyak escribió: > Yes. Of course. > But generally speaking you even need rights to generate schema for > existing database. > Yes, of course, But you do that through the settings you define at nhibernate configuration which stores your credential

[nhusers] Re: Automatically create database if it does not exist

2009-10-27 Thread Dmitiry Nagirnyak
Yes. Of course. But generally speaking you even need rights to generate schema for existing database. This is not really related to the actual question. I manually execute create schema script for MsSql using existing connection string (Trusted Conn.) but changing the database to master. With tru

[nhusers] Re: Generic IDictionary mapping

2009-10-27 Thread José F . Romaniello
A regular Enum property mapped as an int?, I've heard something about that I think in that case you have a _ghost_: http://fabiomaulo.blogspot.com/2008/10/how-test-your-mappings-ghostbuster.html Execute the ghostbuster

[nhusers] Re: Automatically create database if it does not exist

2009-10-27 Thread José F . Romaniello
The problem is that you need have rights to do that 2009/10/26 Dmitiry Nagirnyak > Hi, > > Just wondering is it is possible to tell NHibernate to create the database > if it doesn't exists. > Obviously, SchemaExport should not do it (and it doesn't). > > So lookead at Dialect but it doesn't look

[nhusers] about session per-request implementation

2009-10-27 Thread kor
hi all, i need to use a session per-request pattern in a web enviroinment (pure asp.net 2.0) but i have same doubts. in same example i see that in the http module there's only the bind/ unbind of the session and the transaction are explicity managed by the user every time that it's needed. in ot

[nhusers] Re: Getting a progress status of long operations

2009-10-27 Thread Vadgros
typo, sorry. meant to say - I CAN report the progress myself without the NH events. I just don't want to. I'd rather save a complex data structure using cascades and a single save() than write a method to go through everything inside... On Oct 27, 10:29 am, Sidar Ok wrote: > >> I cant report the

[nhusers] Re: Multi tenancy with NHibernate

2009-10-27 Thread Niclas Pehrsson
Hmm. I'm not really sure about all the details here but I will try to make an prototype and return if I can't solve it all :). On 27 Okt, 05:32, Fabio Maulo wrote: > If you want an example you can use > thishttp://code.google.com/p/unhaddins/source/browse/trunk/uNhAddIns/uNhA... > >

[nhusers] Re: Getting a progress status of long operations

2009-10-27 Thread Sidar Ok
>> I cant report the progress myself without the NH events. Why can't you use events, say Pre/Post Insert ? On Tue, Oct 27, 2009 at 9:07 AM, Vadgros wrote: > > Hey. > > Thanks for the responses. > > Jason, if I'm doing something like: > > foreach(var entity in entities) > { > session.Save

[nhusers] Re: Getting a progress status of long operations

2009-10-27 Thread Vadgros
Hey. Thanks for the responses. Jason, if I'm doing something like: foreach(var entity in entities) { session.Save(entity); } I cant report the progress myself without the NH events. Fabio - The process runs on a different thread and nothing gets stuck. However, I hate operation that ta

[nhusers] Re: Generic IDictionary mapping

2009-10-27 Thread Mark
Thanks for the observation, but if I just have a regular property of an enum it maps it no problem, so why not in this case ? why is it inconsistent ? Are you saying that it is impossible to map an enum keyed IDictionary ? On Oct 27, 4:42 am, Fabio Maulo wrote: > enum!=int > > 2009/10/26 Mark