[nhusers] Re: Pluggable IStatistics?

2008-09-10 Thread Roger Kratz
from nhib/StatisticsImpl. From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Fabio Maulo Sent: den 9 september 2008 17:32 To: nhusers@googlegroups.com Subject: [nhusers] Re: Pluggable IStatistics? Statistics will have some performance info in NH2.1 2008/9/9 Roger Kratz

[nhusers] Re: maintaining query logic

2008-09-18 Thread Roger Kratz
This is a very personal opinion but... If I got you correctly you have a lot of sp:s with business logic and now you want to put the business logic into queries using a nhib? My suggestion is - don't do it. If you prefer seeing a db as a place for storing data _and_ a place for business logic

[nhusers] Why that many columns?

2008-09-22 Thread Roger Kratz
from A a inner join a.B b where or CreateCriteria(typeof(A)).CreateAlias(B,b, JoinType.InnerJoin) Why is b's data returned in the result set/part of the select clause (if fetch or SetFetchMode isn't used)? I'm feel I'm missing something obvious here... /Roger

[nhusers] SNIReadSync

2008-09-22 Thread Roger Kratz
Hi From time to time when analyzing queries, much time are spent in SNINAtiveMethodWrapper.SNIReadSync when NHybridDataReader is grabbing data out of the datareader. I would guess this is more of an ado.net question than nhib, but I'm sort of in the dark here... I got the impression that I've

[nhusers] Re: SNIReadSync

2008-09-23 Thread Roger Kratz
september 2008 05:55 To: nhusers@googlegroups.com Subject: [nhusers] Re: SNIReadSync This is the call that actually read from the DB. SNI is the SQL protocol. The reason that you see those numbers being high is that the DB is performing more work On Tue, Sep 23, 2008 at 2:36 AM, Roger Kratz [EMAIL

[nhusers] Re: SNIReadSync

2008-09-23 Thread Roger Kratz
, 2008 at 11:53 AM, Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: I'll be glad to, but how do you want the test (you do mean a unit test I guess)? I rely on dotTrace on this one. Cannot assert it so to speak From: nhusers@googlegroups.commailto:nhusers@googlegroups.com

[nhusers] Tell nhib: This collection is empty, don't check in db yourself!

2008-09-23 Thread Roger Kratz
A - BCollection - CCollection - DCollection To avoid cartesian product when eagerly loading a graph of A:s, I split the query into three different ones... select a from A a left join fetch a.BCollection b where [X] select a from A a left join fetch a.CCollection c where [X] select a from A

[nhusers] IResultTransformer on single column

2008-09-30 Thread Roger Kratz
Hi I cannot use my own IResultTransformer when the result set only contains one column. TransformTuple method expects an array of tuples, but will in this case be called with a non array type. Is there any good work around (except adding a dummy column)? Session.CreateQuery(@select

[nhusers] SV: [nhusers] Understanding how NH handles database connections

2008-10-01 Thread Roger Kratz
You can open/close the connection using session.Disconnect()/Reconnect() which is recommended if you hang on to the session for a while. If you use long lived session I agree that it might feel better if the created session was closed (disconnected).to start with. I guess the choosen path is

[nhusers] SV: [nhusers] Re: SV: [nhusers] Understanding how NH handles database connections

2008-10-01 Thread Roger Kratz
a transaction NH release the connection after transaction complete. If you open a session using your connection NH give you the responsibility to do what you want with it. 2008/10/1 Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] You can open/close the connection using session.Disconnect()/Reconnect

[nhusers] SV: [nhusers] Re: SV: [nhusers] Re: SV: [nhusers] Understanding how NH handles database connections

2008-10-01 Thread Roger Kratz
Are you sure ? The default connection release mode is auto that mean AfterTransaction... mmm I must improve the logging of connection manager to check it. 2008/10/1 Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Hmm... I must miss something or maybe I misunderstand your but... When I commit

[nhusers] Re: Design : NHibernate Data coupled with UI layer ??

2008-10-02 Thread Roger Kratz
Have a look at IInterceptor or event listeners (nh =2.0). -Original Message- From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of joe Sent: den 2 oktober 2008 02:18 To: nhusers Subject: [nhusers] Design : NHibernate Data coupled with UI layer ?? Dear experts. I have

[nhusers] Re: SV: [nhusers] Re: SV: [nhusers] Understanding how NH handles database connections

2008-10-03 Thread Roger Kratz
@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roger Kratz Sent: den 2 oktober 2008 00:11 To: nhusers@googlegroups.com Subject: [nhusers] SV: [nhusers] Re: SV: [nhusers] Re: SV: [nhusers] Understanding how NH handles database connections I double checked it, asserting in some tests in the trunk

[nhusers] Re: SV: [nhusers] Re: SV: [nhusers] Understanding how NH handles database connections

2008-10-03 Thread Roger Kratz
to verify it. It working as expected... BTW the work for the weekend stay there because I must check the aggressive-release-mode. Why, in your opinion, set the connection to null is a problem ? 2008/10/3 Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Fabio, Regarding this one about

[nhusers] union-subclass explicit fk naming

2008-10-06 Thread Roger Kratz
Hi When using union-subclass, the foreign-key naming in the base type does not work. No crash, but the foreign key won't be named as stated. Is this by design/known issue or should I JIRA this? class name=Base ... many-to-one name=Foo foreign-key=ThisNamingDoesNotMatter / union-subclass

[nhusers] SV: [nhusers] Does NH really have Persistence Ignorance with POCOs? (Proxies question)

2008-10-07 Thread Roger Kratz
Just a few notes... Force me to make all of my methods and properties virtual, for the use of proxies Let the proxies be created by deriving from an interface instead. class proxy=yourInterface public virtual string FName { get { return _fname; } set {

[nhusers] SV: [nhusers] TransientObjectException?

2008-10-08 Thread Roger Kratz
Look at cascade in the docs. Från: nhusers@googlegroups.com [EMAIL PROTECTED] f#246;r ursuletzu [EMAIL PROTECTED] Skickat: den 9 oktober 2008 00:15 Till: nhusers Ämne: [nhusers] TransientObjectException? Hi, I am new to NHibernate and i encountered this

[nhusers] Re: TransientObjectException?

2008-10-09 Thread Roger Kratz
: den 9 oktober 2008 00:29 To: nhusers Subject: [nhusers] Re: TransientObjectException? Thanks, that was it. Unfortunately it has the default NONE... hm... On Oct 9, 1:18 am, Roger Kratz [EMAIL PROTECTED] wrote: Look at cascade in the docs. Från: nhusers

[nhusers] Re: TransientObjectException?

2008-10-09 Thread Roger Kratz
9 oktober 2008 10:44 To: nhusers@googlegroups.com Subject: [nhusers] Re: TransientObjectException? Could you please provide an example why the model would become a mess? On Thu, Oct 9, 2008 at 10:56 AM, Roger Kratz [EMAIL PROTECTED] wrote: Making clear, distinct boundaries where your graph

[nhusers] Session.Merge() - session dirty

2008-10-09 Thread Roger Kratz
Hi Is this suppose to work? Entity ent=[...]; Entity entClone =ent.DeepCloneOfAggregate(); ... session.Lock(ent, LockMode.None); session.Merge(entClone); --has not been changed Assert.IsFalse(session.IsDirty()); It works if ent does not have any collection. If it has, the session becomes

[nhusers] Re: System.String property with fixed length

2008-10-20 Thread Roger Kratz
length=x works for me - if you mean you want SchemaExport to generate a nvarchar(x) column for your string property. Or do you mean that you want SchemaExport to generate a (n)char column? -Original Message- From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Papy

[nhusers] Re: how to attach a detach entity with the persistent state

2008-10-20 Thread Roger Kratz
Don't know if I understand you but... ISession.Refresh(entity)? -Original Message- From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of antoschka Sent: den 20 oktober 2008 16:34 To: nhusers Subject: [nhusers] how to attach a detach entity with the persistent state Hi,

[nhusers] SV: [nhusers] Re: how to attach a detach entity with the persistent state

2008-10-20 Thread Roger Kratz
: [nhusers] Re: how to attach a detach entity with the persistent state 2008/10/20 Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Don't know if I understand you but... ISession.Refresh(entity)? mmm better session.Merge or any other action methods. Refresh do the Refresh from DB. -- Fabio Maulo

[nhusers] Re: When is IFlushEntityEventListener called

2008-10-22 Thread Roger Kratz
IFlushEventListener sniff if there is something dirty. IFlushEntityEventListener find what is dirty. I've learned what these interface do the hard way. IMHO - it would have saved me quite some time if small comments like yours/better comments than now/ were written as comments on the source

[nhusers] RE: Proxied entities...

2008-10-28 Thread Roger Kratz
A B sess.loadA won't hit the database so nhib will create an A proxy instance for you, making it possible to fill A (and B) with data later. If you query for A objects (and no eager fetching is used), you will get A's data back and therefore a real A instance can be created. However B will

[nhusers] RE: Proxied entities...

2008-10-28 Thread Roger Kratz
then. Is it possible for me to figure out in NH 1.2 if the proxied entity in that property is loaded or not, without triggering it to load? From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roger Kratz Sent: Tuesday, October 28, 2008 9:55 AM To: nhusers@googlegroups.com Subject

[nhusers] Refresh - deleted child object

2008-10-29 Thread Roger Kratz
A Bcollection (all-delete-orphan) When refreshing an A instance and one B object has been deleted in data source from some other ISession, an exception is thrown (No row with the given identifier exists). Somewhere back in my head I think I've read that this is by design and not a bug

[nhusers] Re: Refresh - deleted child object

2008-10-30 Thread Roger Kratz
these matter 2008/10/29 Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] A Bcollection (all-delete-orphan) When refreshing an A instance and one B object has been deleted in data source from some other ISession, an exception is thrown (No row with the given identifier exists). Somewhere

[nhusers] query-param

2008-11-03 Thread Roger Kratz
Hi query name=myQuery query-param name=a type=b / The xsd schema for nh 2.0 offers query-param above. However - I cannot see how it's used? Does not matter what I write in name or type - no crash, not anything. Is it true, this tag is not used in nh 2.0? Or is it some setting that needs

[nhusers] SV: [nhusers] Testing database access

2008-11-05 Thread Roger Kratz
When I'm testing against a non inmemory db, I use SetupFixture to create the schema and then have some base class for the testfixtures where you start a transaction in the setup and do a rollback in teardown. There are some drawbacks like the need of some hack if you need two ISessions in a

[nhusers] Re: Optimisation Question

2008-11-12 Thread Roger Kratz
You can't let the db do the work for you? http://www.hibernate.org/hib_docs/reference/en/html/mapping.html 5.1.21 - on-delete=cascade -Original Message- From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Paladin_za Sent: den 12 november 2008 06:34 To: nhusers Subject:

[nhusers] Re: Optimisation Question

2008-11-12 Thread Roger Kratz
single selects at a time) query the whole object graph for the entity in question in one shot. I'm just not sure how I would go about doing this... On Nov 12, 10:53 am, Roger Kratz [EMAIL PROTECTED] wrote: You can't let the db do the work for you?http://www.hibernate.org/hib_docs/reference/en

[nhusers] Re: Repository Example

2008-11-14 Thread Roger Kratz
I use something like... IxxxRepository(IUnitOfWork) ...where an IUnitOfWork holds a nhib ISession Then one IUnitOfWorkFactory object for each ISessionFactory that creates IUnitOfWork instances. A singleton object knows what IUnitOfWorkFactory to use based on which user it is. -Original

[nhusers] Re: New, Need Help with ISession/Configuration

2008-11-19 Thread Roger Kratz
I got the impression that you recreate your IsessionFactory over and over again for each request/every call to your data layer? Creating an ISessionFactory is an expansive op. Create the instance in some start up code for your web app and reuse it. -Original Message- From:

[nhusers] Re: difficult (?) mapping with components and interface

2008-11-20 Thread Roger Kratz
Creating your own IUserType for IPayment would do the trick I guess. -Original Message- From: nhusers@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jan Limpens Sent: den 20 november 2008 15:15 To: nhusers@googlegroups.com Subject: [nhusers] difficult (?) mapping with components

[nhusers] Duplicated db columns in result set

2008-11-24 Thread Roger Kratz
Hi When eagerly loading collections using ICriteria, I've noticed that some columns sometimes are returned multiple times. I haven't had a closer look what makes this happen though. Before digging deeper into this (and creating a JIRA ticket), I just want to check if this is by design (cannot

[nhusers] Re: Duplicated db columns in result set

2008-11-24 Thread Roger Kratz
it is used as the FK reference of the association On Mon, Nov 24, 2008 at 12:59 PM, Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Hi When eagerly loading collections using ICriteria, I've noticed that some columns sometimes are returned multiple times. I haven't had a closer look

[nhusers] Re: Duplicated db columns in result set

2008-11-24 Thread Roger Kratz
reference of the association On Mon, Nov 24, 2008 at 12:59 PM, Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Hi When eagerly loading collections using ICriteria, I've noticed that some columns sometimes are returned multiple times. I haven't had a closer look what makes

[nhusers] Re: Duplicated db columns in result set

2008-11-24 Thread Roger Kratz
is that NH has no guaratees that they will be the same column. On Mon, Nov 24, 2008 at 3:06 PM, Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: FYI There are other situation where data is sent over the wire as multiple, identical columns... * Bidirectional refs will have two

[nhusers] Re: Duplicated db columns in result set

2008-11-24 Thread Roger Kratz
columns in result set The problem is that trying to do this logic is complex and unfriendly. The cost for the user is an extra column that is being sent, but that is not going to cost any additional I/O. On Mon, Nov 24, 2008 at 9:45 PM, Roger Kratz [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote

[nhusers] Re: Lazy Loading

2008-12-11 Thread Roger Kratz
Can't you just explicitly load the clients in a separate query when you need these and let nh glue them/init the proxies to the graph? Either by using the same uow/ISession or reattach the the owners and the run this query? -Original Message- From: nhusers@googlegroups.com

[nhusers] Re: How to test Finder pattern

2008-12-16 Thread Roger Kratz
When I test db queries, I want to involve a data source. I want to test that the query returns correct data - that's what I want to test. What would 1 below give you (more than code coverage)? I defiantly would say 2. -Original Message- From: nhusers@googlegroups.com

[nhusers] exists(..) when filter are used (HQL)

2008-12-19 Thread Roger Kratz
Hi There seems to be some problem with the following hql query... [ from Foo f where f.Aaa=:aaa and exists(from Bar b where [...]) ] ...if filter(s) are declared for Bar. The parameters (=resulting @p0, @p1) are messed up. One parameter gets another's parameter value. (Eg, it seems that @p0

SV: [nhusers] Performance Prolem and Exceptions

2009-01-11 Thread Roger Kratz
What version are you using? If I remember correctly, a lot of these handled exceptions disappeared in 2.0.1. /Roger Från: nhusers@googlegroups.com [nhus...@googlegroups.com] f#246;r antoschka [hueb...@gmail.com] Skickat: den 11 januari 2009 14:46 Till:

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Roger Kratz
Remove the type=[...] in the mapping. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Adeel Sent: den 15 januari 2009 14:56 To: nhusers Subject: [nhusers] IsDirty() is true when retrieving objects Hibernate version: Nhibernate

[nhusers] Re: IsDirty() is true when retrieving objects

2009-01-15 Thread Roger Kratz
Ah, sorry - didn't see you had your own IUSertype. Forget my mail. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Adeel Sent: den 15 januari 2009 14:56 To: nhusers Subject: [nhusers] IsDirty() is true when retrieving objects Hibernate

SV: [nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-15 Thread Roger Kratz
It's a lot easier to create an in-memory list of customers to query against than setup records in the db. Why? Maybe I'm missing something but... inMemList.Add() vs repository.Add() is pretty similar? Från: nhusers@googlegroups.com [nhus...@googlegroups.com]

[nhusers] Re: Testing NHibernate, Mocking ISession

2009-01-16 Thread Roger Kratz
tests, I have to manage cleanup so the db is in a good state before the next test runs. But an in-memory collection will be cleaned up for me automatically by the garbage collector (or at least I don't have to worry about it). On Thu, Jan 15, 2009 at 4:36 PM, Roger Kratz roger.kr

[nhusers] Re: Session trouble ?

2009-01-26 Thread Roger Kratz
The Isession is a 1st level cache. When the query is rerun, nh will reuse the instances it already holds. ISession is both a unitofwork and identity map http://martinfowler.com/eaaCatalog/unitOfWork.html http://martinfowler.com/eaaCatalog/identityMap.html Also, I would, in normal cases,

[nhusers] Re: Nhibernate agnostic about some columns

2009-02-02 Thread Roger Kratz
IIRC you can set access to readonly in trunk version. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of ilmatte Sent: den 2 februari 2009 16:12 To: nhusers Subject: [nhusers] Nhibernate agnostic about some columns Hello, I would like to

[nhusers] Re: Uni-directional one-to-many mapping....

2009-02-10 Thread Roger Kratz
I'm led to believe that this is because NHibernate wants to do an insert with EmployeeId as NULL and then update it to the ID of the parent, and I have a non-null constraint on employeeID. Yes. Or am I going to have to put the Employee reference in employee status? Yes. Use a bidirectional

[nhusers] Re: Cartesian product produced by HQL join

2009-02-13 Thread Roger Kratz
No mapping problem. There are different solutions to this, one is to add .SetResultTransformer(CriteriaUtil.DistinctRootEntity) to your query -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of James L Sent: den 13 februari 2009 11:13 To:

[nhusers] Re: Objects State Validation Business Rules in non Trivial Domain Models

2009-02-17 Thread Roger Kratz
If I understand you correctly you want optimistic version control on aggregates rather than entities/dbrows? It depends... In the app I'm working with right now we're always have bidirectional refs within an aggregates which make it quite easy/fast to find the aggregate root at persist time

SV: [nhusers] Re: Objects State Validation Business Rules in non Trivial Domain Models

2009-02-17 Thread Roger Kratz
READ. This with minimal intrusion into the Domain Model? Thanks in advance for all the help. On Feb 17, 3:01 pm, Roger Kratz roger.kr...@teleopti.com wrote: If I understand you correctly you want optimistic version control on aggregates rather than entities/dbrows? It depends

[nhusers] Re: Objects State Validation Business Rules in non Trivial Domain Models

2009-02-18 Thread Roger Kratz
business rules (say a store does not allow orders above a certain value like some others). The objB would be for instance the Store. Cheers, Nuno On Feb 17, 8:44 pm, Roger Kratz roger.kr...@teleopti.com wrote: Thank you for your post Katz. I understand what you are saying but wouldn't

[nhusers] Re: When/how does NHibernate check its 1st level cache?

2009-03-02 Thread Roger Kratz
so just to clarify, if I did a Load by key, the 1st level cache will be checked, otherwise it won't? FYI ISession is also an identity map (http://martinfowler.com/eaaCatalog/identityMap.html), ensuring no duplicate instances exists in one ISession/uow. This check of the state in ISession

SV: [nhusers] SetFetchMode allows non-existent property

2009-03-05 Thread Roger Kratz
I was wondering the same question a while ago. IIRC, the reason why an exception isn't thrown in this case is nh's ability for polymorphistic queries. In your case, it does not have to be a Cat you get back but a DomesticCat or whatever. In other words - just because your prop doesn't exist in

[nhusers] Re: issue with bi-directional one-to-many association when saving

2009-03-09 Thread Roger Kratz
myPerson.AddCar(myCar) -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of graphicsxp Sent: den 9 mars 2009 16:52 To: nhusers Subject: [nhusers] issue with bi-directional one-to-many association when saving Hello, I have a question about

[nhusers] TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
Hi The new (NH-1657) TimeSpan type gives wrong result if timespan value is more than 24 hours or negative (I'm using sql2005 dialect, not mention any type in mapping file - datetime in db). Am I suppose to use TimeSpanInt64 to get this to work or is it a bug? Should I JIRA this? IMHO - If

[nhusers] Re: TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
the Db.Type: time. Then you will able to persist times between: 00:00:00.00 to 23:59:59.999. On Wed, Mar 25, 2009 at 10:54 AM, Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com wrote: Done http://nhjira.koah.net/browse/NH-1715 From: nhusers@googlegroups.commailto:nhusers

[nhusers] Re: TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
...@googlegroups.com] On Behalf Of Dario Quintana Sent: den 25 mars 2009 17:14 To: nhusers@googlegroups.com Subject: [nhusers] Re: TimeSpan 24h or 0h Roger, hi On Wed, Mar 25, 2009 at 1:03 PM, Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com wrote: IMHO - even with timespan between 0 and 24h

[nhusers] Re: TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
...@googlegroups.com] On Behalf Of Dario Quintana Sent: den 25 mars 2009 17:32 To: nhusers@googlegroups.com Subject: [nhusers] Re: TimeSpan 24h or 0h Yes, the problem is with Sql 2005. Would be nice to see a patch for this dialect. On Wed, Mar 25, 2009 at 1:20 PM, Roger Kratz roger.kr

[nhusers] Re: TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
be nice to see a patch for this dialect. On Wed, Mar 25, 2009 at 1:20 PM, Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com wrote: Im using sql2005 dialect. (no explicit type in mapping file - datetime column) Whatever I persist... Assert.AreEqual(orgObj.MyTimeSpan

[nhusers] Re: TimeSpan 24h or 0h

2009-03-25 Thread Roger Kratz
if you like? From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Dario Quintana Sent: den 25 mars 2009 17:14 To: nhusers@googlegroups.com Subject: [nhusers] Re: TimeSpan 24h or 0h Roger, hi On Wed, Mar 25, 2009 at 1:03 PM, Roger Kratz roger.kr

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

2009-04-01 Thread Roger Kratz
Either by using three different selects, [get type3 where xxx] [get type2 where xxx] [get type1 where xxx] ...preferable batching these queries using MultiCriteria/Query ...or... Getting a wider set back, using joins. SetFetchMode(Reference, FetchMode.Join), Criteria join fetch, HQL /Roger

[nhusers] Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
Hi Let's say I have property name=MappedX type=MyUserTypeForX [...] In my case every time a type X is mapped, I want my IUserType/ICompositeUserType MyUserTypeForX to be used. Can I somewhere tell NH this instead of explicitly repeat this in the mapping files? Of course this is no big deal,

[nhusers] Re: Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
april 2009 15:50 To: nhusers@googlegroups.com Subject: [nhusers] Re: Default IUserType/ICompositeUserType for certain type typedef is for short. We can implement something more to use typedef even when you don't specify the type in a property. 2009/4/2 Roger Kratz roger.kr

[nhusers] Re: Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
/ICompositeUserType for certain type here i describe how to use typedef: http://gustavoringel.blogspot.com/2009/02/encrypting-password-or-other-strings-in.html On Thu, Apr 2, 2009 at 1:28 PM, Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com wrote: Hi Let's say I have property name

[nhusers] Re: Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
Subject: [nhusers] Re: Default IUserType/ICompositeUserType for certain type here i describe how to use typedef: http://gustavoringel.blogspot.com/2009/02/encrypting-password-or-other-strings-in.html On Thu, Apr 2, 2009 at 1:28 PM, Roger Kratz roger.kr...@teleopti.commailto:roger.kr

[nhusers] Re: Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
*blush* I just realized that, yes. From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Fabio Maulo Sent: den 2 april 2009 16:03 To: nhusers@googlegroups.com Subject: [nhusers] Re: Default IUserType/ICompositeUserType for certain type 2009/4/2 Roger Kratz roger.kr

[nhusers] Re: Default IUserType/ICompositeUserType for certain type

2009-04-02 Thread Roger Kratz
ticked about include typedef, in the heuristic process, when the 'type' is not defined for a property. 2009/4/2 Fabio Maulo fabioma...@gmail.commailto:fabioma...@gmail.com 2009/4/2 Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com Maybe it does help yes. Just reusing the old

[nhusers] Re: how to detect changes to entities

2009-04-03 Thread Roger Kratz
http://www.dil.univ-mrs.fr/~massat/docs/hibernate-3.1/api/org/hibernate/Session.html#merge(java.lang.Object) -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of graphicsxp Sent: den 3 april 2009 16:09 To: nhusers Subject: [nhusers] Re: how

SV: [nhusers] Re: how to detect changes to entities

2009-04-06 Thread Roger Kratz
- delete-orphan) Can you help with this ? On 3 avr, 15:12, Roger Kratz roger.kr...@teleopti.com wrote: http://www.dil.univ-mrs.fr/~massat/docs/hibernate-3.1/api/org/hiberna .. .) -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com

[nhusers] Re: Left outer join in hql

2009-04-09 Thread Roger Kratz
Nhibernate is an o(bject)/r mapper. Hql is a query language where you query for objects not db tables (nor db columns). I suggest you to read the manual to give you a good understanding of what nh is. You can find it here http://nhforge.org/doc/nh/en/index.html Depending of what you're trying

SV: [nhusers] Version

2009-04-23 Thread Roger Kratz
As far as I know, NH has no built in support for coarse grained locks (http://www.martinfowler.com/eaaCatalog/coarseGrainedLock.html). I guess there are different ways to solve this but we solved it using an interceptor. Inside our aggregates every ref is bidirectional (we need it for other

[nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many

2009-04-29 Thread Roger Kratz
StatelessSession doesn't do cascade operations, AFAIK. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of mscheibler Sent: den 29 april 2009 07:57 To: nhusers Subject: [nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many

[nhusers] Re: IStatelessSession.Insert and uni-directional one-to-many

2009-04-29 Thread Roger Kratz
thinking about extending the interface with something like IStatelessSession.InsertMany(object entity, string manyProperty). Do you think something like that would word? If yes, would you consider including into the trunk? Michael On 29 Apr., 09:40, Roger Kratz roger.kr...@teleopti.com wrote

[nhusers] Proxy Equals/GetHashcode

2009-05-04 Thread Roger Kratz
Hi Short version... Why not allowing Equals/GetHashcode calls without initializing proxy when the impl of these methods only use id on their entity data? Longer version... In some use cases we've got plenty of Equals calls. The entities I call equals on, isn't really needed for the use case

[nhusers] MultiXxx and filters

2009-05-05 Thread Roger Kratz
Hi Having a MultiCritiera (and MultiQuery I guess) with queries with different enabled filters doesn't seem to work as expected. Is this something that should work? If not (I fully respect if this is a no-no due to the fact that filters belong to a session and not a db query), would it be

SV: [nhusers] Superfluous update?

2009-05-11 Thread Roger Kratz
Have a bidirectional ref and mark the collection with inverse=true. Från: nhusers@googlegroups.com [nhus...@googlegroups.com] f#246;r Krzysztof Koźmic [krzysztof.koz...@gmail.com] Skickat: den 11 maj 2009 21:52 Till: nhusers@googlegroups.com Ämne:

SV: SV: [nhusers] Superfluous update?

2009-05-11 Thread Roger Kratz
@googlegroups.com Ämne: Re: SV: [nhusers] Superfluous update? I *don't* want to have bidirectional ref. I want my model just like it is now. And still, it's besides the point which is - why is NHibernate doing two rountrips to the DB for something it could (or could it?) do in one. Krzysztof Roger

RE: SV: [nhusers] Superfluous update?

2009-05-12 Thread Roger Kratz
be reasonable to put a not-null=true on the association. Krzysztof Fabio Maulo pisze: 2009/5/11 Roger Kratz roger.kr...@teleopti.commailto:roger.kr...@teleopti.com http://www.cs.bham.ac.uk/~aps/syllabi/2004_2005/issws/h03/hibernate.html#one_to_many_unidirhttp://www.cs.bham.ac.uk/%7Eaps/syllabi

[nhusers] Re: Bidirectional association - bidirectionally settable

2009-05-13 Thread Roger Kratz
How is this suppose to work on transient entities if you have a PI domain model? But no, nh doesn't do this for you. Not even on persistent entities. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of dnagir Sent: den 13 maj 2009 11:50

[nhusers] Re: Bidirectional association - bidirectionally settable

2009-05-14 Thread Roger Kratz
, 1:38 am, Roger Kratz roger.kr...@teleopti.com wrote: How is this suppose to work on transient entities if you have a PI domain model? But no, nh doesn't do this for you. Not even on persistent entities. -Original Message- From: nhusers@googlegroups.com [mailto:nhus

[nhusers] Re: Parent Child problem

2009-05-14 Thread Roger Kratz
delete one child from my parent by calling remove on the childs list cascade=all_delete_orphan -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Niclas Pehrsson Sent: den 14 maj 2009 11:08 To: nhusers Subject: [nhusers] Parent Child

[nhusers] Re: Parent Child problem

2009-05-14 Thread Roger Kratz
but I get this execption: NHibernate.MappingException: Unsupported cascade style: all_delete_orphan Im running NHibernate 2.1alpha On May 14, 11:18 am, Roger Kratz roger.kr...@teleopti.com wrote: delete one child from my parent by calling remove on the childs list cascade=all_delete_orphan

[nhusers] Re: Bidirectional association - bidirectionally settable

2009-05-14 Thread Roger Kratz
: Bidirectional association - bidirectionally settable Why? I want consumer to be able to modify the collection. On May 14, 5:45 pm, Roger Kratz roger.kr...@teleopti.com wrote: So it is pretty easy to make a mistake (not very common but still): Don't offer an IList/ICollection but an IEnumerable

[nhusers] Re: Bidirectional association - bidirectionally settable

2009-05-15 Thread Roger Kratz
, 9:58 pm, Roger Kratz roger.kr...@teleopti.com wrote: On Blog, have a method that sets both directions void AddPost(IPost post)    _posts.Add(post);    post.Parent(this); -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of dnagir Sent

[nhusers] Re: HQL vs Criterion

2009-05-19 Thread Roger Kratz
Criteria * Nicer api if you want to build the query at runtime. * Can query non mapped types HQL * Can be pre parsed * Easier (?) syntax for dba:s * Collection stuff (elements, all, minIndex, maxIndex etc) are better supported in HQL afaik (Certainly there are more diffs, but these were the

[nhusers] Re: HQL vs Criterion

2009-05-19 Thread Roger Kratz
you can not make cartesian products with criteria. ? aCartesianProduct = s.CreateCriteria(typeof(Foo)) .SetFetchMode(ACollection, FetchMode.Join) .SetFetchMode(BCollection, FetchMode.Join) .SetFetchMode(CCollection, FetchMode.Join) .SetFetchMode(DCollection, FetchMode.Join) .ListFoo();

[nhusers] Re: HQL vs Criterion

2009-05-19 Thread Roger Kratz
joins from Foo to everywhere. all with an ON clause on the join. SELECT ... FROM Table1, Table2-- (no join) -- (no rel restricting WHERE) this can be done in HQL, and afaik not in Criteria On Tue, May 19, 2009 at 2:48 PM, Roger Kratz roger.kr

[nhusers] Re: Loading objects with readonly state

2009-05-26 Thread Roger Kratz
If your real world case is more complex than your example (?), I would consider impl state pattern rather than your enum. giving the object an initialization state IIRC - I've seen some example at nhforge how to use a parameterized ctor, but if you want to keep your design, it's seems a lot

[nhusers] Re: Load a second instance of an object

2009-05-27 Thread Roger Kratz
I don't know what you're trying to accomplish but... Each isession is an identity map. If you read an entity in another session, you will have two different instances. -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Fred F. Sent: den

[nhusers] Re: Initialize foreign obejcts

2009-06-15 Thread Roger Kratz
You should read/google/learn more about how nh is using proxies. http://nhforge.org/doc/nh/en/index.html#performance-fetching-initialization Also, try read/google/learn more about session management in asp.net scenarios. NHibernate Burrow has some typical implementations about this and can be a

[nhusers] Re: Defining a user type for decimal with precision

2009-07-01 Thread Roger Kratz
There were some issues with decimal db type http://nhjira.koah.net/browse/NH-1594 Are you using latest nh bits? -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Stefan Steinegger Sent: den 1 juli 2009 13:54 To: nhusers Subject: [nhusers]

SV: [nhusers] Length attribute in property element

2009-07-14 Thread Roger Kratz
It's used by SchemaExport. It may also be used by you (or other fw) if you need this info for your own purposes. AFAIK, nh does not use this info for any validation/truncation at all. How should this be done in some general way? Truncated? Throw ex? Trim the string? etc etc /Roger

SV: [nhusers] Properties and Proxies

2009-07-15 Thread Roger Kratz
nhibernateutil.isinitialized(entityOrCollectionProxy) Från: nhusers@googlegroups.com [nhus...@googlegroups.com] f#246;r mantzas [smantzia...@gmail.com] Skickat: den 15 juli 2009 13:27 Till: nhusers Ämne: [nhusers] Properties and Proxies Hi, i am

SV: [nhusers] Re: NHibernate-2.1.0.GA-bin.zip corrupt?

2009-07-21 Thread Roger Kratz
I've had the same problem wint nant + xpzip some time ago in our app. Maybe this is the problem? http://stackoverflow.com/questions/522421/how-can-i-get-output-of-nant-zip-task-to-be-unzipped-on-xp (not my post but describes the issue I had some time ago) Från:

[nhusers] Re: NHibernate 2.1 Dependency Injection and/or Proxy Issue

2009-08-18 Thread Roger Kratz
Use interfaces in your model Eg IUser ICompany Company {get; set;} -Original Message- From: nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] On Behalf Of Nick Clarke Sent: den 18 augusti 2009 12:13 To: nhusers Subject: [nhusers] NHibernate 2.1 Dependency Injection and/or

[nhusers] 2nd level cache - session's timestamp

2009-08-20 Thread Roger Kratz
Hi AFAIK session's timestamp isn't ever changed. Why isn't it updated when it commits a transaction? That would potentially give more cache hits if its life time spans more than one transaction. It's not a big deal at all, I'm more curious _why_ - it's obviously something that I miss. In what

  1   2   3   >