Re: [nhusers] Re: Anyway to turn off row update count ?

2010-08-24 Thread Fabio Maulo
You can implements your own batcher and inject it through NH configuration. In your batcher you can nullify the row-count-check. When you will have a real issue related to updated rows you can light a candle in church and pray a while to find it. On Tue, Aug 24, 2010 at 10:53 AM, empe...@gmail.com

Re: [nhusers] a problem in a very simple nhibernate project

2010-08-24 Thread Jason Dentler
How about giving us the full stack trace of this exception? We can guess all day about the source. On Tue, Aug 24, 2010 at 3:56 PM, José F. Romaniello wrote: > 2010/8/24 saeed-vakili > > from PGroup as p order by p.groupID asc > > > There is a problem in your query "groupID" is the name of the C

Re: [nhusers] a problem in a very simple nhibernate project

2010-08-24 Thread José F . Romaniello
2010/8/24 saeed-vakili > from PGroup as p order by p.groupID asc There is a problem in your query "groupID" is the name of the Column, but the name of the property seems to be GroupId. But, this is not the cause of the object reference exception, by sure. Are you sure you have an instance of s

[nhusers] a problem in a very simple nhibernate project

2010-08-24 Thread saeed-vakili
Hello my friends I am a beginner in nhibernat.and I should develop an nhibernate project. In first step I want read a table from database and show its rows in a gridview. The table name is PGroup . the below method has problem and when run this line (IQuery iquery = session.CreateQuery(query);) lin

Re: [nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread Phil Whittaker
I've not seen much documentation, i just played with it to see what it did. It really is very useful... On Tue, Aug 24, 2010 at 5:12 PM, George Mauer wrote: > Thanks for trying to help. Is there any documentation on what fetch > actually does? > > On Aug 24, 11:08 am, philw wrote: > > Hi Georg

Re: [nhusers] Re: Stop load when accessing Id

2010-08-24 Thread Diego Mijelshon
When Equals is overridden, calling it causes proxy initialization. But if you are loading the currencies in the same session, you don't need to do that; NHibernate will create only one instance of each Curreny, so default Equals or even == comparison will work. Diego On Tue, Aug 24, 2010 at

Re: [nhusers] Re: Some instance's type is like "xxxxxxProxyfbd6621e466a4c7f8e9623ee071237b4" when i get a collection

2010-08-24 Thread José F . Romaniello
Ok, but then read this: "NHibernate is lazy, just live with it" http://ayende.com/Blog/archive/2010/08/04/nhibernate-is-lazy-just-live-with-it.aspx 2010/8/24 chen leeing > Thanks, james and José > > I will try ViewModel later. > *Now, i'm set lazy to 'False' to fix this problem.* > * > * > *Than

Re: [nhusers] Re: NH-1637 & NH-1638 - Paging with rownum in Oracle

2010-08-24 Thread Fabio Maulo
Sam, If you have a particular issue using one of the new Oracle dialects, please create another issue describing the problem, thanks. The best description could be a failing test. On Tue, Aug 24, 2010 at 9:17 AM, sferrise wrote: > Forgive me if that's posted somewhere, but even browsing the sou

Re: [nhusers] Re: Some instance's type is like "xxxxxxProxyfbd6621e466a4c7f8e9623ee071237b4" when i get a collection

2010-08-24 Thread chen leeing
Thanks, james and José I will try ViewModel later. *Now, i'm set lazy to 'False' to fix this problem.* * * *Thanks very much!* * * *Regards, litgle * On Tue, Aug 24, 2010 at 8:18 PM, José F. Romaniello wrote: > I agree with James, I have tried this long time ago, but I ended with this > and other

[nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread George Mauer
Thanks for trying to help. Is there any documentation on what fetch actually does? On Aug 24, 11:08 am, philw wrote: > Hi George > > When I use the fetch function it allows me to pull back an entire > hierarchy in one sql call as it uses joins instead of separate sql > calls. I'm not sure why yo

[nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread philw
Hi George When I use the fetch function it allows me to pull back an entire hierarchy in one sql call as it uses joins instead of separate sql calls. I'm not sure why your hieracrhy is creating so much sql. I think the best thing for you to do would be to play with the fetch statement, both in yo

[nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread George Mauer
Update: I tried the following: public FolderHierarchyNode Get() { using (var s = _sessions.OpenSession()) return s.CreateQuery("select n from FolderHierarchyNode n join fetch n._children") .SetResultTransformer(new global::NHibernate.

[nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread George Mauer
Not sure I get it Phil. Are you suggesting that I join NODES unto itself and then preform a DistinctRootEnity transform? On Aug 24, 9:43 am, philw wrote: > Hi > > I think this might be of some help to you, ot was for me > > http://ayende.com/Blog/archive/2009/08/28/nhibernate-tips-amp-tricks-...

[nhusers] Re: Union-Subclass in different assembly than base class

2010-08-24 Thread Carl B
Well, I figured out that the NHibernate configuration wasn't properly referencing the Common.DataObjects.dll for mapping files. So that fixed the first error. Now it complains (rightfully so, RFTM) that I can't use identity for the ID. My question is then, what would you recommend as an alternativ

Re: [nhusers] Union-Subclass in different assembly than base class

2010-08-24 Thread John Davidson
Have you marked the NewsItem.hbm.xml file as an Embedded Resource? John Davidson On Tue, Aug 24, 2010 at 10:19 AM, Carl B wrote: > I have a common library used by many of our applications, > Common.DataObjects.dll > > In this library, I have defined a NewsItem > > In our new calendaring applica

[nhusers] Complex searching with Nhibernate

2010-08-24 Thread Luka
Hi, I have this problem: When I try to implement Ayende's complex searching found at: http://ayende.com/Blog/archive/2006/12/07/ComplexSearchingQueryingWithNHibernate.aspx with the object graph: Person: M:1 Address: M:1 Street:

[nhusers] Re: Bug with nHibernate and DateTime values as part of a composite key on SQL 2008 with version optimistic-locking?

2010-08-24 Thread MattO
Frans, Well can't change the database structure yet. Instead I fixed it this way by changing my datetime property on my entity to remove millseconds and seconds from the time. [DomainSignature] public virtual System.DateTime DateEntered { get {

[nhusers] Re: Querying dictionary with HQL

2010-08-24 Thread zoranpro
I get this error when trying to do like that: System.Data.SqlClient.SqlException: An expression of non-boolean type specified in a context where a condition is expected, near ','. Incorrect syntax near the keyword 'join'. Not sure if my approach is good. Mapping was already there and I need to wri

[nhusers] Re: Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread philw
Hi I think this might be of some help to you, ot was for me http://ayende.com/Blog/archive/2009/08/28/nhibernate-tips-amp-tricks-efficiently-selecting-a-tree.aspx Phil On Aug 24, 3:38 pm, George Mauer wrote: > I have the following simple domain model representing a hierarchy: > >   public clas

[nhusers] Best way to get rid of unnecessary sql calls in a hierarchy query

2010-08-24 Thread George Mauer
I have the following simple domain model representing a hierarchy: public class FolderHierarchyNode { public virtual Guid Id { get; private set; } public virtual string Name { get; private set; } public virtual FolderHierarchyNode Parent { get; set; } ICollect

RE: [nhusers] Re: Bug with nHibernate and DateTime values as part of a composite key on SQL 2008 with version optimistic-locking?

2010-08-24 Thread Frans Bouma
why not use a 'timestamp' type instead? A date/time field is never going to work, as SQLServer stores it with a precision of 300ms, so every action on the row within 300ms will look like it's ok, while it's not. FB > Okay, I figured out what the issue is, but still wondering what to do. T

[nhusers] Re: Bug with nHibernate and DateTime values as part of a composite key on SQL 2008 with version optimistic-locking?

2010-08-24 Thread MattO
Okay, I figured out what the issue is, but still wondering what to do. The table is defined with the SQL datatype of "smalldatetime", and therefore doesn't store the actual SECONDS portion of the time, but nHibernate passes that in and therefore can't find the timestamp value. What do I do to tel

[nhusers] Union-Subclass in different assembly than base class

2010-08-24 Thread Carl B
I have a common library used by many of our applications, Common.DataObjects.dll In this library, I have defined a NewsItem In our new calendaring application, I've created a subclass, CalendarNewsItem, which adds a few properties and methods to NewsItem. This is in Common.Cal.dll In this applic

[nhusers] Bug with nHibernate and DateTime values as part of a composite key on SQL 2008 with version optimistic-locking?

2010-08-24 Thread MattO
I'm getting the following error when running the flush command after trying to persist an object to the database. I've ran a SQL profiler trace and I see what is wrong, but I don't know how to fix it. Basically nHibernate is inserting the record to the database properly, but when it goes to retri

[nhusers] One-to-optional relationships in a three-level tree

2010-08-24 Thread Alex
We have an object model represented roughly by the following interfaces: /// /// Metadata of a version of an exported document. /// public interface IExport { Guid Id { get; } IList Requests { get; } IExportRequest CurrentRequest { get; } ... } /// /// Represent

[nhusers] Re: Stop load when accessing Id

2010-08-24 Thread vin
Hi, Here you go. Equality is tested by the Equals function below, that is what calls the Id property. On Aug 24, 3:50 pm, José F. Romaniello wrote: > Please show your Currency class and mappings, and aslo show us how do you do > the equality in currency. --- Class --- public class Currency {

[nhusers] Re: Anyway to turn off row update count ?

2010-08-24 Thread empe...@gmail.com
That's certainly some workaround. But not exactly I want. I don't want to keep track of what I updated explicitly. On Aug 24, 3:33 pm, Diego Mijelshon wrote: > You can use an HQL update. > >     Diego > > On Mon, Aug 23, 2010 at 03:26, empe...@gmail.com wrote: > > Hello, It maybe a naive questi

Re: [nhusers] Stop load when accessing Id

2010-08-24 Thread José F . Romaniello
This is the default behavior of NHibernate. Please show your Currency class and mappings, and aslo show us how do you do the equality in currency. 2010/8/24 vin > Is there any way of telling NHibernate to return the Id value of the > Currency object to me without loading the whole object? > --

[nhusers] Stop load when accessing Id

2010-08-24 Thread vin
Hi, I have a problem with NHibernate loading too much data. I have classes with an Id property, there are some many-to-one relationships based on an the Id. So for example a Country has a Currency. I have a table of Countries and one of Currencies and there is a CurrencyId column in the Country

Re: [nhusers] Querying dictionary with HQL

2010-08-24 Thread José F . Romaniello
I think index is just for scalar (lets say when you have a list or a map with "map-key", or "index" in the old syntax). I am not sure if you can use here the row-value-constructor syntax here, try this: from OrganisationNode node inner join node.NodeNamePaths node_paths where (:id, :mdbid) in ind

[nhusers] Querying dictionary with HQL

2010-08-24 Thread zoranpro
Hello, I have problem to write HQL when DTO is having dictionary. This is how mapping is look like: And in DTO there is prop: IDictionary NodeNamePaths I tried writing like this: from OrganisationNode node inner join node.NodeNamePaths no

Re: [nhusers] Anyway to turn off row update count ?

2010-08-24 Thread Diego Mijelshon
You can use an HQL update. Diego On Mon, Aug 23, 2010 at 03:26, empe...@gmail.com wrote: > Hello, It maybe a naive question but I am curious if there is anyway > to turn off row update count. > My scenarios is as follows: > > Consider a persistant entity and two concurrent sessions, where

Re: [nhusers] Re: Some instance's type is like "xxxxxxProxyfbd6621e466a4c7f8e9623ee071237b4" when i get a collection

2010-08-24 Thread José F . Romaniello
I agree with James, I have tried this long time ago, but I ended with this and other problems. Avoid it, write ViewModels 2010/8/24 James Gregory > For exactly this reason, you shouldn't really bind directly against > your domain entities; you should project those entities into DTOs and/ > or Vi

[nhusers] Re: NH-1637 & NH-1638 - Paging with rownum in Oracle

2010-08-24 Thread sferrise
Forgive me if that's posted somewhere, but even browsing the source I didn't see a difference between what I have in NHibernate.Dialect.OraclexxDialect and what was in the repository. I do see your comments on checkin indicating that there were new versions, but I wasn't sure where they may be. T

[nhusers] Re: Some instance's type is like "xxxxxxProxyfbd6621e466a4c7f8e9623ee071237b4" when i get a collection

2010-08-24 Thread James Gregory
For exactly this reason, you shouldn't really bind directly against your domain entities; you should project those entities into DTOs and/ or ViewModel's and bind against those instead. On Aug 24, 3:57 am, litgle wrote: > Now, i post fails code again: > > I have some DataGrid like this: >        

[nhusers] Re: related asp.net GridView

2010-08-24 Thread James Gregory
If your question isn't NHibernate related, it probably shouldn't be asked on an NHibernate mailing list. On Aug 24, 12:47 pm, osman nuri katib wrote: > I want to create a user control or another type control.. > which seems like that: > > > > > > > ... > > > > > 2010/8/24 Wayne Douglas >

Re: [nhusers] related asp.net GridView

2010-08-24 Thread osman nuri katib
I want to create a user control or another type control.. which seems like that: ... 2010/8/24 Wayne Douglas > what is all that? > > shudder. > > On Tue, Aug 24, 2010 at 12:05 PM, osman nuri katib < > osmannurika...@gmail.com> wrote: > >> Hello I want to ask a question not related nhib

Re: [nhusers] NH-1637 & NH-1638 - Paging with rownum in Oracle

2010-08-24 Thread Fabio Maulo
On Mon, Aug 23, 2010 at 4:58 PM, sferrise wrote: > > I looked at the patch specified in NH-1638 and it seems to correct the > issue, but it doesn't appear that the patch has made it into any > version of nHibernate. > > Have you looked to all new dialects for Oracle ? -- Fabio Maulo -- You rec

Re: [nhusers] related asp.net GridView

2010-08-24 Thread Wayne Douglas
what is all that? shudder. On Tue, Aug 24, 2010 at 12:05 PM, osman nuri katib wrote: > Hello I want to ask a question not related nhibernate. > > How can I identify my collections? > > I want to override GridView control's collection like that: > > > > > > > ... > > > > > Is that possibl

[nhusers] Re: Found shared references to a collection

2010-08-24 Thread philw
I have solved the issue, I had a generic function that was setting all the product collections and creating a circular reference. -- 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 unsubs

[nhusers] related asp.net GridView

2010-08-24 Thread osman nuri katib
Hello I want to ask a question not related nhibernate. How can I identify my collections? I want to override GridView control's collection like that: ... Is that possible? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this gr

[nhusers] Found shared references to a collection

2010-08-24 Thread philw
I have a product object that contains 2 collections, accessories and consumers. Consumers relates to an accessory, the list of products that consume it. In the database I have a many to many relationship for these collections that is implemented as a linking table Product_Accessory. In mapping I ha

[nhusers] Caching not working for associated entities unless specified in mapping file

2010-08-24 Thread Chuck Boyde
I am having a problem getting associated entities to be cached unless they are specified (Not.LazyLoad() in mapping). If I build up a query in Criteria or Linq the Main Entity is cached, but not associated entities. IList news; using (var session = factory.OpenSession())

[nhusers] Independent subclass element cannot extend another subclass

2010-08-24 Thread ggeurts
Hello, I am encountering a regression bug in the NHibernate 3.0.0 builds. The following mapping document now throws a NHIbernate.MappingException with message "These classes referenced by 'extends' were not found": It seems that the hi

[nhusers] Re: How to bypass inheritance mapping and just serialize an entity subclass to a table

2010-08-24 Thread ggeurts
You could consider writing a complex user type (implementation of IComplexUserType) that reads/writes the values of the object_type and object_data columns and performs the serialization/deserialization. Regards, Gerke. On Aug 23, 8:36 am, Wayne Douglas wrote: > Could you use discriminator? > >

[nhusers] Re: Business key involving related object

2010-08-24 Thread Frank
Hi Thomas, Okay, Method 2 should work for me since the contract always has to be loaded anyway. >From the random bits and pieces on the net I think the GetHashCode method should compute the hashcode using my business key and the Equals Method should get equality by comparing all properties. At le