[nhusers] Re: Inheritance growing complexity, trying to find a better strategy

2010-06-29 Thread Marc Climent
Yes. I have a Node table and then with joined-subclass a table per class. So, when I get the child nodes of a node, NHibernate fetches rows from Node and joins them with all the other tables from classes that inherit from node. I understand that behavior but I don't know how to refactor this in

[nhusers] Mapping/DDL, naming unique index by using unique-key property

2010-06-29 Thread Fethi Gürcan
Hello, May be it is a basic question, but i couldn't. in the mapping file, i have been trying to give a familiar name to my unique index for a while, (i can give for non-unique indexes) so i've tried to use *unique-key=CustomName* in my mapping file instead of *unique=true* attribute. or have

Re: [nhusers] Re: Inheritance growing complexity, trying to find a better strategy

2010-06-29 Thread Oskar Berggren
Could you have one table for the whole hierarchy instead? Or maybe limit the tree to just the tree structure: Node and LeafNode, which both inherit from NodeChild. Node will have a collection of NodeChild, i.e. other leaf and non-leaf nodes. LeafNode will have a reference to the actual item.

Re: [nhusers] Inheritance growing complexity, trying to find a better strategy

2010-06-29 Thread Sergej Koščejev
The first obvious suggestion would be to use a table-per-class-hierarchy mapping instead, using subclass and a discriminator column. Do you have any objections to that? Sergej On 28.6.2010 18:44, Marc Climent wrote: Hi all! I have a class structure like this one, which seemed a good idea

[nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
Hi all. I have got an error that is giving me headache. Iam getting a mapping exception of duplicate class/entity mapping entityname. I have used nhibernate in 2 previous projects and neva got such. My hbm file is perfect . Anyone with an idea? -- You received this message because you are

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

2010-06-29 Thread Sal
Where does the ApplicationConfiguration class live? Do you bootstrap NH in this class as well? If this class exists in your UI layer, don't you still need a reference to the NH dll for it to run? On Jun 29, 12:58 am, Fabio Maulo fabioma...@gmail.com wrote: All projects where I'm working to

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread John Davidson
Can you provide the complete error information? That will allow us to start a proper analysis of the problem. It is most likely somewhere in your hbm files or your NHibernate initialization. John Davidson On Tue, Jun 29, 2010 at 5:49 AM, Harold Wanyama wanyal...@gmail.com wrote: Hi all. I have

Re: [nhusers] Mapping/DDL, naming unique index by using unique-key property

2010-06-29 Thread Fabio Maulo
That is not NH by default, you have something else in the middle. -- Fabio Maulo El 29/06/2010, a las 04:09, Fethi Gürcan fethigur...@gmail.com escribió: Hello, May be it is a basic question, but i couldn't. in the mapping file, i have been trying to give a familiar name to my unique index

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Fabio Maulo
Yes, you have a duplicated file/classname or duplicated entity-name -- Fabio Maulo El 29/06/2010, a las 06:49, Harold Wanyama wanyal...@gmail.com escribió: Hi all. I have got an error that is giving me headache. Iam getting a mapping exception of duplicate class/entity mapping entityname. I

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

2010-06-29 Thread Fabio Maulo
No I don't. What I need is the NH dll copiede in the bin folder but not a reference to NH, nor to Castle, nor to ServiceLocator, nor to NHV etc. Etc. -- Fabio Maulo El 29/06/2010, a las 07:48, Sal salbass...@hotmail.com escribió: Where does the ApplicationConfiguration class live? Do you

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
Could not compile the mapping document: Naads.Data.Implementation.Domain.Farmer.hbm.xml NHibernate.MappingException: Could not compile the mapping document: Naads.Data.Implementation.Domain.Farmer.hbm.xml --- Here is the Exception NHibernate.DuplicateMappingException: Duplicate class/entity

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Fabio Maulo
You have two mappings pointing to Naads.Domain.Farmer On Tue, Jun 29, 2010 at 9:00 AM, Harold Wanyama wanyal...@gmail.com wrote: Could not compile the mapping document: Naads.Data.Implementation.Domain.Farmer.hbm.xml NHibernate.MappingException: Could not compile the mapping document:

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
Really? I only have one mapping document. On Tue, Jun 29, 2010 at 3:16 PM, Fabio Maulo fabioma...@gmail.com wrote: You have two mappings pointing to Naads.Domain.Farmer On Tue, Jun 29, 2010 at 9:00 AM, Harold Wanyama wanyal...@gmail.comwrote: Could not compile the mapping document:

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread John Davidson
The second mapping document that is being processed is at: Naads.Data.Implementation.Domain.Farmer.hbm.xml while the document is originally mapped via: Naads.Domain.Farmer.hbm.xml This is probably an error in your configuration setup. John Davidson On Tue, Jun 29, 2010 at 8:21

Re: [nhusers] Inheritance growing complexity, trying to find a better strategy

2010-06-29 Thread Fabio Maulo
2010/6/28 Sergej Koščejev sergey@gmail.com The first obvious suggestion would be to use a table-per-class-hierarchy mapping instead, using subclass and a discriminator column. Do you have any objections to that? Sergej WELCOME back Sergej!!! For new users: Sergej aka justme84, is

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
Thnx for that point out. Will check it out On Tue, Jun 29, 2010 at 3:26 PM, John Davidson jwdavid...@gmail.com wrote: The second mapping document that is being processed is at: Naads.Data.Implementation.Domain.Farmer.hbm.xml while the document is originally mapped via:

[nhusers] Re: Calling UDFs?

2010-06-29 Thread Walter Johnson
I receive this error when I change it to SetString Test method Framework.UnitTests.UnitTest1.getACurrSP threw exception: System.InvalidCastException: Unable to cast object of type 'NHibernate.Impl.SqlQueryImpl' to type 'System.IConvertible'.. Here is the UDF inside the mapping sql-query

[nhusers] Re: Calling UDFs?

2010-06-29 Thread Walter Johnson
I have now changed it to this: cursell = (decimal)session.GetNamedQuery(GetCurrSellPrice).SetString(code,'+ acode+').UniqueResult(); and I receive this error: Test method Framework.UnitTests.UnitTest1.getACurrSP threw exception: NHibernate.ADOException: could not execute query [ SELECT

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
John, its not mapped via Naads.Domain.Farmer.hbm.xml like you pointed out. My mappings are in Naads.Data.Implementation.Domain.Farmer.hbm.xml. It beats my understanding as to how i have duplicate mappings On Tue, Jun 29, 2010 at 3:28 PM, Harold Wanyama wanyal...@gmail.com wrote: Thnx for that

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

2010-06-29 Thread Sal
@Fabio, Could you share a little more of your configuration approach? It may be beneficial to several people. On Jun 29, 7:55 am, Fabio Maulo fabioma...@gmail.com wrote: No I don't. What I need is the NH dll copiede in the bin folder but not a reference to NH, nor to Castle, nor to

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread John Davidson
It is the mapping file that specifies it is in Naads.Domain: hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=Naads.Domain namespace=Naads.Domain John Davidson On Tue, Jun 29, 2010 at 8:52 AM, Harold Wanyama wanyal...@gmail.com wrote: John, its not mapped via

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

2010-06-29 Thread John Davidson
nadav has provided a mini project, with code, that I will writeup by the end of this weekend on NHForge.org. It should better document this approach. John Davidson On Tue, Jun 29, 2010 at 8:55 AM, Sal salbass...@hotmail.com wrote: @Fabio, Could you share a little more of your configuration

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

2010-06-29 Thread Fabio Maulo
http://fabiomaulo.blogspot.com/2009/09/configure-sessionfactory-providers.html http://fabiomaulo.blogspot.com/2009/11/guywire.html On Tue, Jun 29, 2010 at 9:55 AM, Sal salbass...@hotmail.com wrote: @Fabio, Could you share a little more of your configuration approach? It may be beneficial to

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

2010-06-29 Thread John Davidson
The first assumption (I know) is that an application requiring NHibernate is also going to have unit testing. Unit Testing means that there will be at least one separate dll for the unit tests, as they should not be part of the production code. In having a separate unit test dll there is then the

Re: [nhusers] Re: Calling UDFs?

2010-06-29 Thread Fabio Maulo
I have realized that I can't answer to ppl who use try-hope, re-try-re-hope, re-try-re-hope changing everything in each try. Sorry. On Tue, Jun 29, 2010 at 9:46 AM, Walter Johnson exoter...@gmail.com wrote: I have now changed it to this: cursell =

[nhusers] Re: Inheritance growing complexity, trying to find a better strategy

2010-06-29 Thread Marc Climent
Hi Sergej, (and Oskar btw) This is more or less the same idea pointed by Oskar. It will be the best solution but I don't know in that case how to cope with all the different properties that each node type has, because if I leave them as they are now, there will be many many columns, that's why I

[nhusers] Re: Calling UDFs?

2010-06-29 Thread Walter Johnson
I am not pinning my results on hope. I am not new to coding, just new to NHibernate. I just want to learn how I can call a UDF using NHibernate. On Jun 29, 8:44 am, Fabio Maulo fabioma...@gmail.com wrote: I have realized that I can't answer to ppl who use try-hope, re-try-re-hope,

Re: [nhusers] Re: Calling UDFs?

2010-06-29 Thread Fabio Maulo
you can register your function in your custom dialect inherited from the standard or you can use your named-query without column='Unit Price' (note the space in the column name and the nonexistence of that alias in your query), changing only what I said you without change everything else. On

[nhusers] Re: Calling UDFs?

2010-06-29 Thread Walter Johnson
Are you saying I should take out the column attribute from within the named query? On Jun 29, 9:03 am, Fabio Maulo fabioma...@gmail.com wrote: you can register your function in your custom dialect inherited from the standard or you can use your named-query without  column='Unit Price' (note the

[nhusers] Re: Calling UDFs?

2010-06-29 Thread Walter Johnson
When I took out the column name I received an error so I changed the sql query alias to match the column name. I then used this to return the result: var queryresult = session.GetNamedQuery(GetCurrSellPrice).SetString(code, acode).UniqueResult(); It came back with the result that I needed.

[nhusers] Optimistic Locking Dynamic-Update

2010-06-29 Thread sternr
Hi, If I map a certain entity with dynamic-update=true optimistic- locking, Will NHibernate check properties that are marked as un-dirty? I.E: Lets say I have a Person entity with FirstName,LastName Id. If I change only the FirstName, and SaveOrUpdate, because the entity is mapped with

Re: [nhusers] Re: Calling UDFs?

2010-06-29 Thread Fabio Maulo
And the SetString too -- Fabio Maulo El 29/06/2010, a las 11:40, Walter Johnson exoter...@gmail.com escribió: When I took out the column name I received an error so I changed the sql query alias to match the column name. I then used this to return the result: var queryresult =

[nhusers] Nhibernate Facility Lazy loading problem

2010-06-29 Thread kaivalya
I am migrating my mvc web app to use Nhibernate Facility to manage Nhibernate sessions. I am encountering this strange problem; When I register SessionWebModule under web.config/ httpmodules via: add name=NHibernateSessionWebModule

[nhusers] MultiCriteria.GetResult()

2010-06-29 Thread void*
Howdy y'all, is there any way (besides catching the potential exception that GetResult() will throw) to test if there is a criteria with a given name available in a MultiCriteria? Best regards void* -- You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] Is this unsupported by NHibernate scenario a bad relational database practice?

2010-06-29 Thread Zlamma
I have a model, for which my desired database mapping would be akin to this: table parent ( Id, Child1_Id, Child2_Id, ) table child ( Id, ) The model being: class Parent { Child Child1, Child Child2, } class Child { Parent Parent } This in essence would be a

[nhusers] NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread shosca
Hi, I am looking for the source code for the nhibernate.linq provided on sourceforge. Could anybody point me to where i can download it? Thanks -- You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to

[nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread Vadim Chekan
You mean trunk? https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/ Vadim. On Jun 29, 8:17 am, shosca ser...@hosca.com wrote: Hi, I am looking for the source code for the nhibernate.linq provided on sourceforge. Could anybody point me to where i can download it?

[nhusers] Eager Loading Using Fluent NHibernate/Nhibernate Automapping

2010-06-29 Thread Nabeel
Hi guys, I have a requirement to load a complex object called Node...well its not that complex...it looks like follows:- A Node has a reference to EntityType which has a one to many with Property which in turn has a one to many with PorpertyListValue public class Node { public virtual int

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread Serkan Hosca
Yes i know its in trunk. What i am looking for is the source code for nhibernate.linq.dll for the released version on sourceforge download page. For version 1.0 under 2.1.0GA i can see the release source code but its missing under 2.1.2GA. On Tue, Jun 29, 2010 at 12:52 PM, Vadim Chekan

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread John Davidson
It was moved to NHibernate Contributions on sourceforge after 2.1.0 and added back into the trunk for 3.0 John Davidson On Tue, Jun 29, 2010 at 12:58 PM, Serkan Hosca ser...@hosca.com wrote: Yes i know its in trunk. What i am looking for is the source code for nhibernate.linq.dll for the

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Harold Wanyama
John that specifies the location of my entity but not the .hbm file. Am still at a loss On 6/29/10, John Davidson jwdavid...@gmail.com wrote: It is the mapping file that specifies it is in Naads.Domain: hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 assembly=Naads.Domain

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread Serkan Hosca
I guess it never got released. I looked at the nhcontrib releases too but there is only v1.0. On Tue, Jun 29, 2010 at 1:01 PM, John Davidson jwdavid...@gmail.com wrote: It was moved to NHibernate Contributions on sourceforge after 2.1.0 and added back into the trunk for 3.0 John Davidson

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread John Davidson
Can you provide the code where you build the sessionFactory and load the configuration? John Davidson On Tue, Jun 29, 2010 at 1:03 PM, Harold Wanyama wanyal...@gmail.com wrote: John that specifies the location of my entity but not the .hbm file. Am still at a loss On 6/29/10, John Davidson

Re: [nhusers] Exception error 4 duplicate class

2010-06-29 Thread Ian Escarro
Or can you just fine assembly=Naads.Domain in your project files? There must be more than 1 of it. On Tue, Jun 29, 2010 at 10:09 AM, John Davidson jwdavid...@gmail.comwrote: Can you provide the code where you build the sessionFactory and load the configuration? John Davidson On Tue, Jun

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread Fabio Maulo
No John. The embedded provider of NH3.0 is another world On Tue, Jun 29, 2010 at 2:01 PM, John Davidson jwdavid...@gmail.com wrote: It was moved to NHibernate Contributions on sourceforge after 2.1.0 and added back into the trunk for 3.0 John Davidson On Tue, Jun 29, 2010 at 12:58 PM,

Re: [nhusers] Eager Loading Using Fluent NHibernate/Nhibernate Automapping

2010-06-29 Thread Fabio Maulo
which is the strange thing ? On Tue, Jun 29, 2010 at 1:53 PM, Nabeel nabeelfa...@gmail.com wrote: Hi guys, I have a requirement to load a complex object called Node...well its not that complex...it looks like follows:- A Node has a reference to EntityType which has a one to many with

[nhusers] NHibernate and IIS Web Garden

2010-06-29 Thread chitech
Alo I just surf around and found this link http://www.alachisoft.com/ncache/nhibernate_index.html with this statement: Drawbacks of Regular NHibernate Cache: Cannot handle ASP.NET web gardens: ASP.NET app runs in multiple worker processes in a web garden configuration. This creates multiple in-

Re: [nhusers] NHibernate and IIS Web Garden

2010-06-29 Thread Oskar Berggren
The commercial speaks of 2-level cache. You yourself mention 1-level cache, which is a different thing. The 1-level cache is local to one ISession instance and destroyed when that instance is no longer used. Most applications seem to use a pattern where each ISession instance is only used to a

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread John Davidson
I Understan that the LINQ in NH3.0 is a new implementation based on HQL rather than ICriteria as was the case for nhibernate-linq 1.0 John Davidson On Tue, Jun 29, 2010 at 2:35 PM, Fabio Maulo fabioma...@gmail.com wrote: No John. The embedded provider of NH3.0 is another world On Tue, Jun

Re: [nhusers] Re: NHibernate.Linq-1.1.0.1001 source code missing on sourceforge

2010-06-29 Thread Fabio Maulo
exactly... another world ;) On Tue, Jun 29, 2010 at 5:14 PM, John Davidson jwdavid...@gmail.com wrote: I Understan that the LINQ in NH3.0 is a new implementation based on HQL rather than ICriteria as was the case for nhibernate-linq 1.0 John Davidson On Tue, Jun 29, 2010 at 2:35 PM, Fabio

Re: [nhusers] Is this unsupported by NHibernate scenario a bad relational database practice?

2010-06-29 Thread Sergej Koščejev
public class Parent { Child child1; // many-to-one column=child1_id Child child2; // many-to-one column=child2_id } public class Child { Parent parent1; // one-to-one property-ref=child1 Parent parent2; // one-to-one property-ref=child2 } I don't see any way it could be mapped

Re: [nhusers] NHibernate and IIS Web Garden

2010-06-29 Thread John Davidson
The impact on the 1-st level cache depends upon how the web garden has been implemented and how volatile your data is when compared against the number of users that may change the same record. If the web garden has sticky sessions, i.e. the same user is always returned to the same server within

[nhusers] Saving a detached instance

2010-06-29 Thread tqwhite
I send an object to my web browser. Sometime later, the user changes it and send it back. The object gets posted back with its unique id and some data changes. It does not contain any details for dependent objects. When I Update (or SaveOrUpdate) it, the foreign key on each dependent object is

Re: [nhusers] Saving a detached instance

2010-06-29 Thread Jason Dentler
It's not as crazy as you think. This is just one step away from view models. http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/06/29/how-we-do-mvc-view-models.aspx On Tue, Jun 29, 2010 at 4:39 PM, tqwhite tqwh...@gmail.com wrote: I send an object to my web browser. Sometime later, the