[nhusers] Re: Mapping By Code - YesNo

2011-10-30 Thread Kenneth
That's F-NH. He's asking for M-B-C. Try: Property(x => x.IsAdmin, map => map.Type()); Ken -- 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 unsubscribe from this group, send email to

[nhusers] Re: NHibernate 3.2.0 Beta2 released

2011-06-21 Thread Kenneth
I prefer beers. So I guess it's by design? -- 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 unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com. For more op

[nhusers] Re: NHibernate 3.2.0 Beta2 released

2011-06-21 Thread Kenneth
I've just runned the NH-941 test, and it inserts both objects and the child object has the foreignkey in the insert statement, however the "normal" update is STILL executed. So 3 statements are executed. Why? Kenneth -- You received this message because you are subscribed to th

[nhusers] Re: NHibernate 3.2.0 Beta2 released

2011-06-20 Thread Kenneth
http://nhforge.org/doc/nh/en/index.html#example-parentchild-bidir -- 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 unsubscribe from this group, send email to nhusers+unsubscr...@google

[nhusers] Re: One-to-many collection is not loaded when a property is Lazy

2011-06-17 Thread Kenneth
I've created a test solution and a JIRA: http://216.121.112.228/browse/NH-2772 Kenneth -- 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 unsubscribe from this group

[nhusers] One-to-many collection is not loaded when a property is Lazy

2011-06-16 Thread Kenneth
ERE gpstrip0_.Id =1 /* ?p0 */ commit transaction If I remove the lazy on StaticImage everything is working perfect. Kenneth -- 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. T

[nhusers] Re: Mapping by code - a bag

2011-06-10 Thread Kenneth
}, rel => rel.OneToMany() ); Kenneth -- 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 unsubscribe from this group, send email to nhusers+unsubscr...

[nhusers] Re: NHib Linq with orderby count problem

2011-06-09 Thread Kenneth Siewers Møller
Hi, Glad you got it solved. Some of these complex queries aren't supported by native LINQ. I've seen some extensions for LINQ that can perform more complicated queries, but I guess they need to be supported by NHibernate. AFAIK each LINQ expression is translated into SQL, so if the translator

[nhusers] Re: NHib Linq with orderby count problem

2011-06-06 Thread Kenneth Siewers Møller
User2, () => user2) // user2 .OrderBy(Projections.SubQuery(QueryOver.Of(() => user2).Where(user => user.Id == currentUserID).ToRowCountQuery())).Asc .List(); The above example is rewritten to match your example... I don't know what your mappings and entities look like, so it's just an examp

Re: [nhusers] Re: NHib 3.2 and NHib Validator together

2011-06-05 Thread Kenneth Siewers Møller
o this group, send email to nhusers@googlegroups.com. > To unsubscribe from this group, send email to > nhusers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Med venlig hilsen / Kind regards Kenneth Siew

Re: [nhusers] Re: Named entities with Query or QueryOver

2011-06-05 Thread Kenneth Siewers Møller
interfaces clean of any dependencies besides the ones we define and the ones in the FCL. I hope this clarified my problem a bit :) On Mon, Jun 6, 2011 at 01:03, Gunnar Liljas wrote: > No, I guess Kenneth is using "entity-name" mappings, in order to have > multiple mappings for t

[nhusers] Re: Named entities with Query or QueryOver

2011-06-05 Thread Kenneth Siewers Møller
this what you are looking for: > > ... >         public IQueryable FetchAll() >         { >             return SessionInstance.Query(); >         } > ... > > On Jun 4, 12:06 pm, Kenneth Siewers Møller > wrote: > > > > > > > > > Hi, > &

[nhusers] Re: Named entities with Query or QueryOver

2011-06-05 Thread Kenneth Siewers Møller
do, is to use Query<> to return an IQueryable<>, but only use it on a named entity. As far as I can see, that is not currently possible, or maybe I'm missing something? On Jun 5, 5:52 am, Gunnar Liljas wrote: > What do you mean by "returns an IQueryable from a named en

[nhusers] Named entities with Query or QueryOver

2011-06-03 Thread Kenneth Siewers Møller
get it, it through CreateCriteria, but I can't expose ICriteria in the repository interface. Thanks in advance. Kenneth -- 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 un

Re: [nhusers] Latest version of NHibernate un NuGet

2011-04-13 Thread Kenneth Siewers Møller
Ah, nice :) I hate to be confused... Kenneth On Tue, Apr 12, 2011 at 15:42, Fabio Maulo wrote: > Done. > Today there is something new but on Sunday I didn't see it. > > > On Tue, Apr 12, 2011 at 10:39 AM, Fabio Maulo wrote: > >> Is there something new in Nu

[nhusers] Latest version of NHibernate un NuGet

2011-04-12 Thread Kenneth Siewers Møller
Hi, I just realized that NuGet features NHibernate 3.2.0.1001 as the recommended version, but isn't that the Alpha 1 of NH3.2? How can that be the recommended version? -- Med venlig hilsen / Kind regards Kenneth Siewers Møller -- You received this message because you are subscribed t

[nhusers] Re: Override Equals and GetHashCode in a class (C#)

2011-03-08 Thread Kenneth
http://blogs.hibernatingrhinos.com/nhibernate/archive/0001/01/01/identity-field-equality-and-hash-code.aspx -- 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 unsubscribe from this group,

[nhusers] Re: How do you model this?

2010-07-12 Thread Kenneth
Yes, as Fabio wrote, use the tag /K On Jul 13, 7:37 am, Peter Forstmeier wrote: > Hi all, > i follow this thread because i'm very interested on the same subject. > I didn't see any solution right now. Did i miss something. > > Peter > > On 12 Jul., 13:53, Diego Mijelshon wrote: > > > Uh? > > >

[nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Kenneth
* @p0 */ Ken On Apr 8, 8:21 am, Kenneth wrote: > Hi Fabio > > I'm using plain session.Get(1), and the child collections is > lazyloaded. And it's happening when I access the child collection. > > Parent map: >     public class ParentMap : ClassMa

[nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Kenneth
? (HQL, Criteria, QueryOver, Linq) > > 2010/4/7 Kenneth > > > > > Taken from NHProf: > > SELECT cancellati0_.Subscription_id as Subscrip3_1_, > >       cancellati0_.Id              as Id1_, > >       cancellati0_.Id              as Id5_0_, > >

[nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Kenneth
case) > > > > > > On Wed, Apr 7, 2010 at 7:47 AM, Kenneth wrote: > > Guess it goes under: > > >http://groups.google.com/group/nhusers/browse_thread/thread/9fdb20d51... > > > On Apr 7, 9:32 am, Kenneth wrote: > > > Taken from NHProf: > > &

[nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Kenneth
Guess it goes under: http://groups.google.com/group/nhusers/browse_thread/thread/9fdb20d515514e82/3c8f9d8e70f694e8?lnk=gst&q=columns#3c8f9d8e70f694e8 On Apr 7, 9:32 am, Kenneth wrote: > Taken from NHProf: > SELECT cancellati0_.Subscription_id as Subscrip3_1_, >        ca

[nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Kenneth
Hi again It's happening when I have a simple with lazyload, and when the collection is fetched, the above sql is generated. I use get<> on parent object. Using 2.12.400 Anybody knows why?? Ken On Apr 7, 9:32 am, Kenneth wrote: > Taken from NHProf: > SELECT cancellati0_.S

[nhusers] NH selects same column multiple times

2010-04-07 Thread Kenneth
Taken from NHProf: SELECT cancellati0_.Subscription_id as Subscrip3_1_, cancellati0_.Id as Id1_, cancellati0_.Id as Id5_0_, cancellati0_.Dateas Date5_0_, cancellati0_.Subscription_id as Subscrip3_5_0_ FROM [CancellationDate] cancel

[nhusers] Future pattern with fetch on collections

2010-03-31 Thread Kenneth
ill result in a SINGLE query against database, but with multiple recordsets? Kenneth -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhus...@googlegroups.com. To unsubscribe from this group, send email

[nhusers] Re: Enums

2009-07-12 Thread Kenneth Siewers Møller
s it must be generated and compiled... > > any other thoughts??? > > On 11 Ιούλ, 15:14, Kenneth Siewers Møller > wrote: >> I'm actually curious about this as well. Typically I would use lookup >> tables >> for values having persistance meaning. States I put in enu

[nhusers] Re: Enums

2009-07-11 Thread Kenneth Siewers Møller
I'm actually curious about this as well. Typically I would use lookup tables for values having persistance meaning. States I put in enums as an example. There's always a problem mapping between these layers when talking about "static" data. Sometimes I have immutable lookup tables mapped to entitie

[nhusers] Re: Using guid.comb for character(36)

2009-07-01 Thread Kenneth Siewers Møller
Maulo > 2009/7/1 Kenneth Siewers Møller > >> Okay, the db type "bytea" is in fact binary data... So, with this in >> place, how can I persist a Guid in that? > > > Take care. The matter is not only the representation but how the > DataProvider will int

[nhusers] Re: Using guid.comb for character(36)

2009-07-01 Thread Kenneth Siewers Møller
Okay, the db type "bytea" is in fact binary data... So, with this in place, how can I persist a Guid in that? 2009/7/1 Kenneth Siewers Møller > Hmm, unfortunately there isn't any binary column. I guess theres a byte > array ("bytea"), but i don't know if tha

[nhusers] Re: Using guid.comb for character(36)

2009-07-01 Thread Kenneth Siewers Møller
> a good idea. > is there any kind of a binary[128] field you can use instead? then we'll > discuss the mapping > > 2009/7/1 Kenneth Siewers Møller > > Hi >> >> This might be a simple question to answer, but here goes. >> >> We're running a Postg

[nhusers] Using guid.comb for character(36)

2009-07-01 Thread Kenneth Siewers Møller
Hi This might be a simple question to answer, but here goes. We're running a PostgreSQL 8.1 DBMS, which doesn't support UUID. My idea is therefore to continue using GUID's as PK's in my domain model, but simply persist them as character(36) in the database. Is this possible? I've tried just chang

[nhusers] Re: Readable Criteria ?

2009-06-30 Thread Kenneth Siewers Møller
This is excelent news... Then perhaps I can persuade our developers to give NHibernate a shot once more... We're heavy on Postgres, so there isn't really any alternative when talking about ORM's. But when some of our developers start to be amazed by Linq to SQL etc., it's hard to argue against it's

[nhusers] Re: Why is NHibernate doing an Update when I Databind?

2009-06-29 Thread Kenneth Siewers Møller
th of > knowledge it provides. > > the updates happen at flush because this is how NH works. up until you > flush the session NH is simply tracking changes. it's not actually > making changes (that's not entirely true depending on the PK > generator). > > > >

[nhusers] Re: Why is NHibernate doing an Update when I Databind?

2009-06-29 Thread Kenneth Siewers Møller
I don't know whether it's the same issue, but I usually experienced this behavior when I (unintentianally) was modifying my entities when loading them from the database. NHibernate thinks they are dirty and therefore tries to update the changes when the session is flushed. At that time, I didn't fu

[nhusers] Re: HQL vs Criterion

2009-05-20 Thread Kenneth Siewers Møller
What's does the future hold for Criteria API? The introduction of LINQ seems to make a large part of it obsolete, but I haven't really got that much experience with LINQ-to-NH yet. One thing I like from the Criteria API is that it's got compiletime checks, however, it's not of much use if your prop

[nhusers] Re: HQL vs Criterion

2009-05-19 Thread Kenneth Siewers Møller
So, are you saying that because I don't use HQL my application is "wrong". I don't think so. For me it's simply a matter of taste. I prefer using the Criteria API simply because it's easier to manipulate runtime, which is what I need most of the time. I rarely have any static queries, but when I do

[nhusers] "Having" on projection alias using Criteria API

2009-04-27 Thread Kenneth Siewers Møller
Hi there I am working on a rather complex query using the Criteria API. My problem is that I need to test using having on a subquery projection. Is that even possible? Something like this: var projections = Projections.ProjectionList() .Add(Projections.Property("my.Property", "property")) .Add(

[nhusers] Re: Intellisense nhibernate.dll

2009-04-06 Thread Kenneth Siewers Møller
rks? 2009/4/6 Joost > > Yes, it works fine for log4net and iesi for example... > I will check my VS settings in the mean time. > Joost > > On 5 apr, 02:07, Kenneth Siewers Møller > wrote: > > Sounds like something is wrong with your VS settings. Does > > intellisense

[nhusers] Re: Intellisense nhibernate.dll

2009-04-04 Thread Kenneth Siewers Møller
1.781.760 NHibernate.dll > 29-09-2008 10:1524.957 NHibernate.license.txt > 29-03-2009 12:41 5.883.392 NHibernate.pdb > 29-03-2009 12:41 2.044.930 NHibernate.xml > 20 bestand(en) 12.105.157 bytes > > > On 30 mrt, 09:19,

[nhusers] Re: How to eager load a object hierarchy in one batch

2009-04-01 Thread Kenneth Siewers Møller
Could you please post an example of your mapping and query? 2009/4/1 Morten Haug > > Hi Roger, thanks for replying. > > Just some more explanation. Type3 has no object reference to Type2, > there's just a bag of Type3's with a reference to a column (Type3 can > have other Type-parents). I'm not

[nhusers] Re: How to map a bi-directional one-to-many from a component class?

2009-04-01 Thread Kenneth Siewers Møller
You need to post an example of your mapping file and classes. 2009/3/31 Lance Harper > > Is it possible to map a bi-directional one to many relationship from a > component class/map? I am having trouble figuring out how the many-to- > one element on the child map should look. If I make the cla

[nhusers] Re: HQL query doesnt accept column aliases??

2009-03-31 Thread Kenneth Siewers Møller
If you need to select a new object you can use the "select new Cat(c.x, c.y, c.z) from Cat c where ... ". Aliases is not useful when doing a simple select. Otherwise you can use the Criteria API and do a projection instead. Unfortunately it seems like HQL and Criteria API supports different featur

[nhusers] Re: Community help needed

2009-03-30 Thread Kenneth Siewers Møller
I've just realized that actually :) As far as I understand, an implementation of EqualityComparer is actually just a separate overwrite of GetHashCode and Equals. Pretty clever actually :) Perhaps I could have a go at it? 2009/3/30 Fabio Maulo > 2009/3/30 Kenneth Siewers Møller >

[nhusers] Re: Community help needed

2009-03-30 Thread Kenneth Siewers Møller
Uhm, I don't recall ever implementing the EqualityComparer for composite id's..? I've overwritten GetHashCode and Equals, which is what I've been led to believe was the correct approach. Maybe I should have a look at it..? 2009/3/30 Fabio Maulo > 2009/3/30 Kenneth Siew

[nhusers] Re: NH seemingly ignoring access="field" in mapping.

2009-03-30 Thread Kenneth Siewers Møller
It wasn't a solution, merely a pointer in the right direction ;) 2009/3/30 Fabio Maulo > Well... remove lazy-loading is not a solution. > > 2009/3/30 Enrique Ramirez > >> >> Anne, Kenneth, and Fabio, thanks so much for guiding me in the right >> direction. Di

[nhusers] Re: Community help needed

2009-03-30 Thread Kenneth Siewers Møller
So, to understand this correctly, every issue solved in Jira as "Not an issue" should be presented with an explanation and/or solution in the wiki? It makes good sense to explain why some issue won't be resolved. 2009/3/30 Fabio Maulo > Friends.. easy... easy... please not all together... by one

[nhusers] Re: NH seemingly ignoring access="field" in mapping.

2009-03-30 Thread Kenneth Siewers Møller
Try disable lazy loading for the class. 2009/3/30 Anne Epstein > > At least as far as 2.0.1 goes, if you're using lazy loading for a > mapped class, everything public in the class needs to marked as > virtual, regardless of access settings. That includes all properties, > including properties n

[nhusers] Re: Intellisense nhibernate.dll

2009-03-30 Thread Kenneth Siewers Møller
to install or place anything specific to that project. Kenneth 2009/3/29 Fabio Maulo > Alpha2 include all. > > 2009/3/29 Davy Brion > > i have never put xml files for assemblies in Visual Studio's Xml folder so >> i don't know if that works or not... but if you p