-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Thu Jun 01, 2006 10:02 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 4:08 pm
Posts: 28
Great work... one question.

The alpha package's bin directory has 36 class libraries in it compared to the previous version that had more like 4. Any chance of getting a guide on which NHibernate assemblies we need to add references to for what, and are all of the 3rd party assemblies in the bin directory needed?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 02, 2006 3:20 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Just reference NHibernate.dll. I'll add a JIRA task to create a description of what is what in there.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 03, 2006 12:09 am 
Newbie

Joined: Sun Jan 15, 2006 11:51 am
Posts: 8
Thanks for work.

ReflectHelper.cs, line 270: returns null if mapped clsss has constructor with args but has no no-args constructor. Possibly bug?

270: ConstructorInfo constructor = type.GetConstructor( ReflectHelper.AnyVisibilityInstance, null, CallingConventions.HasThis, NoClasses, null);


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 03, 2006 4:46 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Hmm, I'll look into it. It's not a bug, you have to have a no-argument constructor for NHibernate to work, but the function could be written better.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 03, 2006 1:24 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
FritFrut wrote:
Is it now possible to generate Outer Join using Criteria?

Yes, it should work.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 04, 2006 1:51 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 4:08 pm
Posts: 28
So I'm guessing "default-lazy" in the hibernate-mapping sets the default value for both the entities and collections in that mapping file? That's something new with 1.2 right? If so, would it be possible to get that split out into one default for entities and one for collections, or maybe have it as an enum instead of a boolean?

default-lazy="All | Entities | Collections | None"


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 04, 2006 3:41 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Quote:
would it be possible to get that split out into one default for entities and one for collections


Why?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 04, 2006 4:07 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 4:08 pm
Posts: 28
sergey wrote:
Quote:
would it be possible to get that split out into one default for entities and one for collections


Why?


Well, in general I don't like lazy entities because I don't like having to mark all of my properties as virtual. The purist in me finds it offensive (I understand it's necessary) but marking collections as lazy only affects the containers which I'm cool with.

Does that make sense? I dunno, maybe this is an odd request, I just assumed at least a handful of others out there would feel the same.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 4:02 pm 
Beginner
Beginner

Joined: Wed Oct 05, 2005 2:08 pm
Posts: 23
I'm tantalized by the prospect of user-defined collections. I assume this means that I can specify a custom type for my collections that implements IList, ISet, etc and it will be dynamically proxied to support lazy loading.

If this is the case though I can't find any documentation or example of actually using the feature. Does it have to do with the collection-type property? Do all method implementations of the interface have to be virtual? How does it work exactly?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 4:12 pm 
Pro
Pro

Joined: Fri Nov 19, 2004 5:52 pm
Posts: 232
Location: Chicago, IL
I'm not an expert on the internals of NHibernate, but, does NHibernate actually proxy collection classes? i.e. generate IL on the fly. I noticed in the source code that there are NHibernate specific collection classes. So, my assumption was that when reading objects out of the database, it would just use the NHibernate collection classes that correspond to whatever interface it is that you're using. i.e. if you had an IList, you might assign to it an ArrayList to begin with, but, when you read data out of the database, the IList does not point to an ArrayList and instead just uses the appropriate NHibernate collection class. i.e no runtime IL generation for collections as is done in the case of proxied classes.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 4:33 pm 
Beginner
Beginner

Joined: Wed Oct 05, 2005 2:08 pm
Posts: 23
I'm not sure how else you would allow for user-defined collections.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 08, 2006 7:19 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
jstelly wrote:
So I'm guessing "default-lazy" in the hibernate-mapping sets the default value for both the entities and collections in that mapping file? That's something new with 1.2 right? If so, would it be possible to get that split out into one default for entities and one for collections, or maybe have it as an enum instead of a boolean?

default-lazy="All | Entities | Collections | None"


By the way, you may be interested by:
Why associations and collections are lazy by default in NHibernate 1.2.0

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject: Is log4net updated to 1.2.10?
PostPosted: Thu Jun 08, 2006 3:58 pm 
Beginner
Beginner

Joined: Tue Sep 14, 2004 1:03 pm
Posts: 33
Location: Calgary, Alberta Canada
Sounds great,
Does this version update the log4net library to 1.2.10


Top
 Profile  
 
 Post subject: Stable release ?
PostPosted: Tue Jun 13, 2006 5:10 am 
Newbie

Joined: Tue Jun 13, 2006 5:05 am
Posts: 1
Location: Austria/Vienna
Hello Sergey!

Thanks for the great work!

When do you plan to rollout a stable release (estimated) ?

Thank you,
Gerhard


Top
 Profile  
 
 Post subject: nhibernate 1.2.0 alpha and properties lazy loading
PostPosted: Thu Jun 15, 2006 11:32 am 
Newbie

Joined: Thu Jun 15, 2006 11:15 am
Posts: 3
Hi Sergey!
I've just upgraded to nhibernate 1.2.0 alpha,
generics works nice, woo hoo!!!

But I have a problem, please help me!
if I do this:
NHibernate.ISession session = NHibernate.ISession)NHibernateHelper.NHibernateHelper.GetCurrentSession();

MyObject o = session.Load<MyObject>(PK);
///////////////////////////////////////////////////
//NHibernateUtil.Initialize(o.Name);
//NHibernateUtil.Initialize(o.IsActive);
///////////////////////////////////////////////////

session.Flush();

NHibernateHelper.NHibernateHelper.CloseSession();

return o;

I get a lazy loading error on the fields o.Name and o.IsActive!!

If I NHibernateUtil.Initialize(o.Name), I can access this field!!

It's the default behaviour???
How can I specify this lazy="false" in the mapping property??


Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.