[nhusers] nhforge.org under maintenance
Please be patience, we are moving it into better servers -- Dario Quintana -- 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en.
[nhusers] NHibernate Validator and Search at NuGet
Hello friends, Here you've the 2 new packages, enjoy it. http://nuget.org/List/Packages/NHibernate.Validator http://nuget.org/List/Packages/NHibernate.Search <http://nuget.org/List/Packages/NHibernate.Search>Both targeting NHibernate 3.1 GA -- Dario Quintana -- 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en.
Re: [nhusers] Re: How to use Nhibernate Validator + NHib component + ddl
Send us a failing test. Thanks On Sat, Dec 12, 2009 at 5:51 PM, mynkow wrote: > Yes, Fabio. I tried this but it is not working. :( > > - > public class Customer > { > public virtual string Name{get;set;} > public virtual Contact Contacts{ get; } > } > - > public class Contact > { > public virtual string Address{get;set;} > } > - > > namespace="MyNamespace" >assembly="MyAssembly"> > > > > > > > > > > > > > > - > > namespace="MyNamespace" >assembly="MyAssembly"> > > > > > > > > > > - > > > On Dec 11, 3:04 pm, Fabio Maulo wrote: > > Map the class Contact in NHV as a separate class. > > In NHV each class has his own mapping. > > In the class Customer the property Contacts should be mapped as > > > > 2009/12/11 mynkow > > > > > > > > > Sure, > > > > > Ok, I will prepare *hbm, *.nhv, and classes but not in a working > > > project. Is that ok? > > > > > On Dec 9, 11:20 am, Gustavo Ringel wrote: > > > > Can you open an issue in the NHV Jira with a failing test? > > > > > > Thanks. > > > > > > Gustavo. > > > > > > On Fri, Dec 4, 2009 at 12:47 AM, mynkow wrote: > > > > > Hi, > > > > > > > I just configured my NHibValidator. My NHibernate creates the DB > > > > > schema. When I set MaxLenght="20" to some property of a class then > in > > > > > the database the length appears in the database column. I am doing > > > > > this in the NHibValidator xml file. But the problem is that I have > > > > > components and cannot figure out hot to achieve this behaviour. The > > > > > component is configured correctly in the Customer.hbm.xml file. > > > > > > > public class Customer > > > > > { > > > > > public virtual string Name{get;set;} > > > > > public virtual Contact Contacts{ get; } > > > > > } > > > > > > > public class Contact > > > > > { > > > > > public virtual string Address{get;set;} > > > > > } > > > > > > > > > > > > > > > > namespace="MyNamespace" > > > > > assembly="MyAssembly"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > How to configure my Address with MaxLength="50" > and > > > > > to reflect this length into the database column's length? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > 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 to > > > > > nhusers+unsubscr...@googlegroups.com > > > > > > > > > > > > > > > > . > > > > > For more options, visit this group at > > > > >http://groups.google.com/group/nhusers?hl=en. > > > > > -- > > > > > 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 to > > > nhusers+unsubscr...@googlegroups.com > > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > Fabio Maulo > > -- > > 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 to > nhusers+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > > -- Dario Quintana http://darioquintana.com.ar -- 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 to nhusers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
[nhusers] NHForge
Hi all, NHForge will be back to normallity soon, a backup will be restored. Thanks for your patience -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nhforge.org is down?
It's working for me. On Mon, Oct 5, 2009 at 7:03 PM, aponzani wrote: > > Its not just you...still down on some of the Wiki and Groups pages. > > FYI...try http://downforeveryoneorjustme.com/ > > > On Oct 2, 2:07 pm, Jean-Francois Cantin wrote: > > Hi guys, > > > > Anybody else sees nhforge down? I get the following. > > Sorry, there was a problem with your last request! > > > > Either the site is offline or an unhandled error occurred. We apologize > and > > have logged the error. > > Reload the page <http://nhforge.org/>JF > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Preloading Children of a Children collection to avoid Select N+1 issue in tree
Have a look to this example: http://code.google.com/p/darioquintana/source/browse/trunk/Examples/NHibernateExamples/DeepNHibernate/DeepNHibernate.Tests/Queries/Fetch/Fixture.cs The model is: Order -> Line -> Article; and I'm getting whole subset of the graph using *join fetch*. On Mon, Oct 5, 2009 at 4:54 PM, Michael Hedgpeth wrote: > > I have the following tree in WPF: > > Product > -> Feature > -> Subfeature > -> Test Case > > Each type is different, but they all have a Children and Parent > property for navigating the tree. > > When using the WPF TreeView, if you expand one level, it will check > the count of the "Children" property of every child that you > expanded. So if I expanded product it would do something like this > (in the background): > > foreach (Feature f in product.Children) > showPlus = f.Children.Count; > > Thus, this creates a select N+1 issue. > > If I were handwriting the SQL, when product was expanded, I would load > all of the Subfeatures with this query: > > select Subfeature.* > from Product, Feature, Subfeature > where Product.Id = @JustExpandedId > and Subfeature.ParentId = Feature.Id > and Feature.ParentId = Product.Id > > I can't seem to find a way to make it preload all of the children of a > children collection. Making the collection not lazy load does not > seem to fix the problem. What is the best way to do this? > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Documentation #FAIL
It's fixed now. On Sat, Oct 3, 2009 at 1:29 AM, Scott White wrote: > > Currently NHibernate documentation is only loading to section 5.1.2. > I saw others Tweeting about it but it looked fine at work today > (probably cached) and then when I got home I checked again and I saw > the same exact behavior. > > http://nhforge.org/doc/nh/en/index.html > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nhforge.org reference documentation broken
+1 On Wed, Sep 30, 2009 at 2:37 PM, Fabio Maulo wrote: > Well... at this point I don't know what is happening > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nhforge.org reference documentation broken
The malware script was removed, but the doc still being truncated, use the doc provided in the release. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Support for FileStream data type
Hi all, Read the comments in the NH-1650. The example is a test in the trunk, temporarely, and will be removed as soon as somebody post an example (an official example in nhforge). https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/FileStreamSql2008/ <https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/FileStreamSql2008/> Cheers On Mon, Sep 21, 2009 at 12:41 AM, Rob wrote: > > According to this post: > http://zvolkov.com/blog/post/2009/07/20/Whats-new-in-NHibernate-21.aspx > NHibernate 2.1 supports the new FileStream data type from SQL Server > 2008. I've configured my database to support this datatype and can > read and write using ADO. Does anyone know how to configure > NHibernate to map to it? > > Thanks, > Rob > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: DateTime2 SQL2008 millisecond bug?
Thanks ! I will have a look soon. Cheers ;) On Sun, Sep 27, 2009 at 7:24 AM, Graham Bunce wrote: > > Dario, > > I've updated NH-1973 with the latest version of the test case. > > I'll have a look in the NH code to see if I can work out how to fix > it, but I've only just downloaded the codebase and haven't even got it > to compile yet ;) > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: DateTime2 SQL2008 millisecond bug?
Submit a patch with the failing test to our jira: jira.nhforge.org Thanks! On Sat, Sep 26, 2009 at 7:54 AM, Graham Bunce wrote: > > Oskar. Yes I have, and my test fails to confirm it. > >using (ISession session = this.OpenSession()) >{ > DomainClass entity = session.Get(1); >Assert.AreEqual(DateTime.Parse("2009-09-23 16:28:21.489"), > entity.Timestamp); > } > > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: set id to interface mapping
Hey Jan, I don't know Fluent NHibernate, but you should go for access="backfield" if you are using auto-properties. Cheers. On Thu, Sep 24, 2009 at 9:17 PM, Jan Limpens wrote: > Hello, > > I've asked the same thing on stackoverflow, so if someone wants to get the > points, he/she could go there as well :) > > I try to write a (fluent, but that's not the point) mapping against an > interface > > public interface IOrderDiscount : IDomainObject > > where > > public interface IDomainObject : IDomainObject > { >IdT Id { get; } > } > > like so (and all other thinkable varieties of access strategies) > > Id(d => d.Id, "DiscountId") > > .GeneratedBy.HiLo("9") > > .WithUnsavedValue(0) > .Access.AsReadOnlyPropertyThroughCamelCaseField(); > > but all I get are variations of > > Could not find field 'id' in class 'IOrderDiscount' > > My base class implements this as > > public virtual IdT Id { get; protected set; } > > but even using a backing field id does not change a thing. > > So I am left to wonder, how I could get this to work... > Anyone with an idea? Fluent or not... > > -- > Jan > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Why is HiLo algorithm done this way?
You can use your max_Lo with 9 or 99, if you do the maths with a Int64 as column type, you will have Ids for long long time. On Mon, Sep 14, 2009 at 6:39 PM, Delucia wrote: > > I disagree for the following reason: Take this scenario where 2 users > are updating the database and HiLo max_Lo is 1000. > > user 1: > - get next_hi for customer entity -> 1 > - insert custmer -> custmer_id = 1001 > - get next_hi for employee entity -> 2 > - insert employee -> employee_id = 2001 > > user 2: > - get next_hi for customer entity -> 3 > - insert custmer -> custmer_id = 3001 > - get next_hi for employee entity -> 4 > - insert employee -> employee_id = 4001 > > while if you get the next_hi per session it will: > > user session 1: > - get next_hi for customer entity -> 1 > - insert custmer -> custmer_id = 1001 > - insert employee -> employee_id = 1002 > > user session 2: > - get next_hi for customer entity -> 2 > - insert custmer -> custmer_id = 2001 > - insert employee -> employee_id = 2002 > > you can see the second implementation is much better and more > efficient. > > On Sep 14, 5:28 pm, Tuna Toksoz wrote: > > This is something not harmful, why do you care for id's anyway? if you > want > > you can implement your own generator. This is, I believe nice feature of > > Hilo as you can track id's better. > > > > Tuna Toksöz > > Eternal sunshine of the open source mind. > > > > > http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike > > > > > > > > On Mon, Sep 14, 2009 at 4:54 PM, Delucia wrote: > > > 1000- Hide quoted text - > > > > - Show quoted text - > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: ASP.NET MVC Auto Model Binding
Hey Ryan, Raise the question in a Asp.Net Mvc forum, maybe they can help you. Cheers. On Mon, Sep 14, 2009 at 10:58 AM, Ryan Hartzog wrote: > > Thank you Dario. I forgot to mention that I created a ViewModel to > use as well and that still was not binding. I must be missing > something, I just don't get what it is. The ViewModel was a > MyObjectViewModel with public Guid Id { get; set; }, public string > Address1 { get; set; }. Doesn't get much more simple and yet the > binding is just not working for me. > > On Sep 14, 8:46 am, Dario Quintana > wrote: > > I suggest use ViewModel as a bridge. > > > > View -> ViewModel -> Model (your persistent classes) > > > > On Mon, Sep 14, 2009 at 10:34 AM, rhartzog wrote: > > > > > Has anyone had an issue with the auto model binding when using objects > > > persisted with NHibernate? I commented my object down to a simple > > > Guid Id field and string Address1 field and I still can't get auto > > > model binding when accepting an object on the Post action method. I > > > have tried [Bind(Prefix="")], Include, Exclude, etc. The only thing I > > > can get to work is having to gather the values from the FormCollection > > > which kind of sucks. Any suggestions would be greatly appreciated. > > > > -- > > Dario Quintanahttp://darioquintana.com.ar > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: ASP.NET MVC Auto Model Binding
I suggest use ViewModel as a bridge. View -> ViewModel -> Model (your persistent classes) On Mon, Sep 14, 2009 at 10:34 AM, rhartzog wrote: > > Has anyone had an issue with the auto model binding when using objects > persisted with NHibernate? I commented my object down to a simple > Guid Id field and string Address1 field and I still can't get auto > model binding when accepting an object on the Post action method. I > have tried [Bind(Prefix="")], Include, Exclude, etc. The only thing I > can get to work is having to gather the values from the FormCollection > which kind of sucks. Any suggestions would be greatly appreciated. > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Testing full-text-search queries
Hi The problem is that the FTS-index it is not updated yet, it takes a few seconds (2 or 3). Add a delay to see the behaviour with Thread.Sleep(...). The best way is to add a query asking for the Populate State. See the property FULLTEXTCATALOGPROPERTY. Cheers. On Sat, Aug 29, 2009 at 11:07 PM, Darryl Parker wrote: > > I'm stumped. I have a simple object called Listing with two string > properties: Title and Description. I also have a guid Id. This > object and it's properties map to a SQL Server 2008 database. I also > have a full-text index on the Description field. All of my CRUD > persistence tests pass with the exception of full-text query tests. > Here is my simple full-text query method: > > public Listing[] GetByFTS(string searchString){ > >return GetSession().CreateSQLQuery("SELECT * FROM dbo.Listings > WHERE > FREETEXT ([Description], :searchString, LANGUAGE > 1033);","listings", > typeof(Listing)).SetString("searchString", > searchString).List().ToArray(); > } > > By the way, this method works fine when I connect it to a controller > and view. But if fails when I try to do an integration test. The > following integration test ought to pass but it fails saying "Expected > 1 But was 0". > > [Test] > public void Full_Text_Search_Test() > { >Listing listing = new Listing() { Title = "My new > listing", Description = "It is time for all good men to come to the > aid of their country." }; > >PersistEntity(listing); > >IListingRepository repository = new ListingRepository(new > HybridSessionBuilder()); >Listing[] listings = repository.GetByFTS("men"); > >Assert.That(listings.Length, Is.EqualTo(1)); > > } > > The strange thing is, when I set a break point and run this test with > the debugger and step through it, the test passes! It is only when I > run the test normally that it fails to retrive the record I just > added. > > Any ideas? > > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Custom Collection ValidationClass in NHibernate.Validator in ASP.NET MVC
Hey, You don't need an Entity-Validator (which is your CustomFooValidator). You can just use a Pattern validator in the property in the Foo type. public class Foo { [Pattern()] //Pattern is for regex public string SomeProperty {get;set;} } And then you still can have this: [Valid] public virtual IList newNameofthisCollection. And remember, the custom validator comes in two flavors: Entity and Member (Property or Field) Validator. Another solution, remember that you can use Constraint Validator Context, that is, you can disable the default error in a Entity-Validator and add new custom messages in the validator. https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.Validator/src/NHibernate.Validator.Tests/ConstraintContext/ And with Constraint Validator Context you can point an Error Message to a member directly, even using Entity-Validator. Cheers On Thu, Aug 27, 2009 at 3:23 AM, stromflut wrote: > > Hi there! > > I have a collection property of a custom class "foo" (namely an > IList) in which class I have a property "value" and another > property "Regex" which holds the allowed format of "value". To > validate this property, I added the Attribute [Valid] on the topLevel > to the collection as following: > [Valid] > public virtual IList newNameofthisCollection > > Then I have the CustomFooValidator class which is checking the "value" > property against the Regex property and returns false if the property > is invalid. But to make this working, i had to define the Validator to > be a "ClassValidator" adding "AttributeUsage(AttributeTargets.Class)" > to the ValidationClass Definition. > > If it comes to the validation, MVC adds an InvalidValue Object to the > ModelState Property of the Object. The Problem is now, MVC does not > know to what property of "foo", it should map the InvalidValue because > the Object in the Collection has been validated on ClassLevel. > > Does anyone know a way, how to define in the ValidationClass on what > property it should map the ValidationError? Or is there an other way > to validate the collection? > > Thanks a lot, just even for reading and thinking about my problem! > > //stromflut > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate v2.1 and NHibernate Validator 1.0.0 GA not compatible?
You should use NHV 1.2beta1. NHV is going GA, but there are not changes from Beta1 :) On Tue, Aug 25, 2009 at 8:50 AM, Billy Stack wrote: > > All, > > I am trying to validate my entities upon being loaded from the database. > > I am using NHibernate v2.1 > I am using a PostLoadEventListener where I am attempting to use > NHibernate Validator 1.0.0 GA to validate the entity that was loaded. > > However I get the following error: > > {"Could not load file or assembly 'Iesi.Collections, Version=1.0.0.3, > Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its > dependencies. The located assembly's manifest definition does not > match the assembly reference. (Exception from HRESULT: > 0x80131040)":"Iesi.Collections, Version=1.0.0.3, Culture=neutral, > PublicKeyToken=aa95f207798dfdb4"} > > Are both build versions incompatible? > > Billy Stack > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Paging with SQL 2000
Hi all I can't see how a query can be better than a query. An store procedure is just a compiled query. And there is no-way that NHibernate will work with a SP to paginate. Just wondering what exactly you mean with this approach. Cheers 2009/8/21 江名峰 > the best way to do paging is using Stored Procedure. > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Paging with SQL 2000
Yes it is. The eternal fight against the pagination of SQL 2005... MS had created that "nice" way to paginate for us, how cool is that? :-) On Fri, Aug 21, 2009 at 4:50 PM, Renato Duan wrote: > > Is that the expected behavior? Imagine a table with lots of rows, the > performance would not be good… If there is no other way to paging in > SQL Server 2000, I’ll have to do the paging methods using pure > ADO .Net with some customized queries (and I really don’t want to do > this). > > Here is the NH query: > --- > IList< RegiaoFiscal> objetos = session.CreateQuery("from RegiaoFiscal > rf") > .SetFirstResult > (18) > .SetMaxResults(5) > .List(); > --- > > > Here is the query generated for SQL 2005: > --- > SELECT TOP 5 ReF1_0_, ReF2_0_ FROM (select regiaofisc0_.ReF_Cod as > ReF1_0_, regiaofisc0_.ReF_Des as ReF2_0_, ROW_NUMBER() OVER(ORDER BY > CURRENT_TIMESTAMP) as __hibernate_sort_row from tblRegiaoFiscal > regiaofisc0_) as query WHERE query.__hibernate_sort_row > 18 ORDER BY > query.__hibernate_sort_row > --- > > > Here is the query generated for SQL 2000: > --- > select top 23 regiaofisc0_.ReF_Cod as ReF1_0_, regiaofisc0_.ReF_Des as > ReF2_0_ from tblRegiaoFiscal regiaofisc0_ > --- > > Thanks in advance. > > Best regards, > Renato Duran > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Updating Validator message within Class validator
Hey The answer it's called Constraint Validator Context. You can see some code of example of how to manage even multiples messages for the same property https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.Validator/src/NHibernate.Validator.Tests/ConstraintContext/MemberValidation/PasswordValidator.cs And for Entity Validation, example here: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.Validator/src/NHibernate.Validator.Tests/ConstraintContext/EntityValidation/PasswordValidator2.cs You can even disable the default message, but, be sure to add another message replacing the default one, otherwise if no-messages, ends in a *valid* case. Cheers On Wed, Aug 19, 2009 at 7:12 PM, The Bread wrote: > > Hello, > > I am using NHibernate.Validator 1.2.0.2001 with the 2.1GA of > Nhibernate. I am creating a custom class level validator and related > attribute which I am using to validate some logic before allowing the > object to be persisted. I want to update the default error message > with details found during this validation but can't seem to figure out > how to dynamically update the message property. Below is what I have > at the moment. Any help would be greatly appreciated. > > >[AttributeUsage(AttributeTargets.Class)] >[ValidatorClass(typeof(SectionInstanceValidator))] >public class SectionInstanceAttribute : Attribute, IRuleArgs >{ >private string message = string.Empty; >public string Message >{ >get { return message; } >set { message = value; } >} >} > >public class SectionInstanceValidator : IValidator >{ >public bool IsValid(object value, > IConstraintValidatorContext constraintValidatorContext) >{ >if (value is Section) >{ >string message = String.Empty; >var section = value as Section; >var numbers = section.SectionNumbers; >var formats = > Globals.BLL.Generic.GetAll(); > >//Verify all MasterSpecFormats have been defined >foreach (var item in formats) >{ >if (!numbers.Select(o => > o.MasterSpecFormat).Contains(item)) >{ >if (message == > String.Empty) >message += item.Name; >else >message += ", " + item.Name; >} >} >if (!String.IsNullOrEmpty(message)) >{ >//This is the dynamic message I want to return > with the validation error. >message = "Section number missing for " + > message; >return false; > } > else >return true; >} >else >return false; >} >} > > > Thanks, > Chris > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: eager fetching over multiple levels, that's more than 2 :-)
If your question is how to do it, here you have an example: *select o from Order o join fetch o.Lines li join fetch li.Article where o.Id = :Id* OR * s.CreateCriteria(typeof (Order)) .SetFetchMode("Lines", FetchMode.Join) .SetFetchMode("Lines.Article", FetchMode.Join) .Add(Restrictions.Eq("Id", orderId)).UniqueResult();* The 3th level is Article. On Mon, Aug 10, 2009 at 5:21 PM, mhnyborg wrote: > > I just want to here if NH 2.1 has some new features that makes > selection from 3 levels possible. > > for example I want to load all customers with all orders and order > lines. I can get the Customers and orders using > Transformers.DistinctRootEntity but that's only fixes the customer > collection I get to many orders. > > The problem is better explained here: > > http://stackoverflow.com/questions/332703/nhibernate-eager-fetching-over-multiple-levels > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Encrypted Password
You can always use in the configuraton connectionstring_name in the web/app.config and then encrypt the file. Then you can read the connection string and decrypt it programmatically. On Mon, Aug 10, 2009 at 11:31 AM, Maik wrote: > > Hey folks, > > due to security reasons we are forced to only store usernames and > passwords in an encrypted format (prefered encryption algorythm is > AES). Now I want to know, if NHibernate supports something like that. > > Or do I have to implement it myself? > > Thanks for your help. > > Nice Greets from Germany, > Maik > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate-2.1.0.GA-bin.zip corrupt?
Weird, I think the script is the same for both NH and NHV On Tue, Jul 21, 2009 at 1:39 PM, Cheetah wrote: > > FWIW, I just downloaded NHibernate.Validator-1.2.0.Beta1-bin.zip from > sourceforge, and it unzips just fine with XP's built in tool. > > The stackoverflow link Roger Kratz posted describes the same symptoms > I'm seeing, so probably worth trying the fix listed there. > > On Jul 21, 12:12 pm, Dario Quintana > wrote: > > Just wondering... > > Do we have the same problem with NHV ? Becuase all the releases are made > in > > the same way: via NAnt. > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate-2.1.0.GA-bin.zip corrupt?
Just wondering... Do we have the same problem with NHV ? Becuase all the releases are made in the same way: via NAnt. On Tue, Jul 21, 2009 at 1:09 PM, Fabio Maulo wrote: > In fact previous releases was ziped manually using 7zip. > > 2009/7/21 Cheetah > >> >> Since prior releases worked fine with XP's zip tool, if they too were >> generated with NAnt's zip task, then it seems like it's probably a bug >> in whichever zip library NAnt is using. >> >> On Jul 21, 11:58 am, Fabio Maulo wrote: >> > Those files was created using the task of NAnt.If 7zip extract all >> > fine but winXP no, perhaps we should open an issue in Microsoft, or in >> NAnt. >> > I really don't know what I can do... perhaps I should zip all files >> needed >> > manually using 7zip. >> >> >> > > > -- > Fabio Maulo > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Contrib
Hi So far the releases working with 2.1 GA are: NH.Caches 2.1 GA NH.Validator 1.2 Beta1 You can follow the announces via nhforge.org. The feed is: http://feedproxy.google.com/NHibernateBlog Cheers. On Tue, Jul 21, 2009 at 12:13 PM, SteveG wrote: > > I mean, are they using the new NH 2.1 ? > > The problem I always have updating NH is all these other projects > depend on the version - ie. I've had problems with Castle, NHContrib - > ie. NHibernate.Linq, etc.. > > On Jul 21, 8:53 am, Fabio Maulo wrote: > > what you mean ? NHContrib is a container of projects. > > > > 2009/7/21 SteveG > > > > > > > > > With the release of NH 2.1 will I need a new build of NHContrib ? > > > > -- > > Fabio Maulo > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Best approach to several classes and mappings
A 600-classes-project, suppose is a Asp.net application, is started once, and the startup time ocurrs once too. For development matters, you can improve serializing the Configuration object http://nhforge.org/blogs/nhibernate/archive/2009/03/13/an-improvement-on-sessionfactory-initialization.aspx On Sun, Jul 12, 2009 at 1:25 PM, Guga Oliveira wrote: > > We will start a new project, and we think that we will get something > about 600 classes to be mapped to tables in an Oracle Database. > > recently we have found an article saying about problems with several > mapping in nhibernate. About the slow time to start on a project with > this size. > > My question is, what is the best approach? To break the project in > modules, or to use an alternative to compile the mappings, like fluent > or another way. > > Thanks > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: v2.1.0 beta 2 bug under mono 2.4
Hi Ricardo. Take it easy Ricardo, nobody is being hostile here :) I my opinion it's a Mono problem, and you should create an issue here http://mono-project.com/Bugs. If it's a Mono bug, there is nothing we can do. Or Maybe if we find the problem, we can workaround it, but I don't think is a good idea, Mono is a open source project, so like NHibernate you can report this issue and wait to the commiters fix the problems, and with a patch this may go faster. I hope this clarify the situation. Cheers On Mon, Jul 6, 2009 at 7:36 AM, Ricardo Gladwell wrote: > > Hi Dario, > > To explain, the problem here was that: > > 1. The issue was marked closed and I was told to raise it somewhere > but I still don't understand why NHibernate is failing on Mono, so > what exactly am I supposed to raise with Mono? > 2. For Mono users I guess the issue is Critical. If it can be > downgraded that's fine, but I don't understand why that means it > should be closed. > > I'm not sure I understand the hostility at this particular project. > I'll try some other ORM framework. > > Good luck.. > > Ricardo Gladwell > > > -- > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: v2.1.0 beta 2 bug under mono 2.4
ystem.Xml.Serialization/TypeTranslator.cs:163 > > > at > System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers > > > (System.Type type) [0x00244] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:774 > > > at System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping > > > (System.Xml.Serialization.TypeData typeData, > > > System.Xml.Serialization.XmlRootAttribute root, System.String > > > defaultNamespace) [0x0007a] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:343 > > > at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping > > > (System.Xml.Serialization.TypeData typeData, > > > System.Xml.Serialization.XmlRootAttribute root, System.String > > > defaultNamespace) [0x0006e] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:217 > > > --- End of inner exception stack trace --- > > > at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping > > > (System.Xml.Serialization.TypeData typeData, > > > System.Xml.Serialization.XmlRootAttribute root, System.String > > > defaultNamespace) [0x00179] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:237 > > > at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping > > > (System.Type type, System.Xml.Serialization.XmlRootAttribute root, > > > System.String defaultNamespace) [0x0003c] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:192 > > > at System.Xml.Serialization.XmlSerializer..ctor (System.Type type, > > > System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] > > > extraTypes, System.Xml.Serialization.XmlRootAttribute root, > System.String > > > defaultNamespace) [0x00047] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:226 > > > at System.Xml.Serialization.XmlSerializer..ctor (System.Type type) > > > [0x0] in > > > > /root/mono2.4/mono-2.4/mcs/class/System.XML/System.Xml.XPath/Parser.cs:1 > > > at NHibernate.Cfg.XmlHbmBinding.Binder.Deserialize[HbmMapping] > > > (System.Xml.XmlNode node) [0x0] > > > at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind > (System.Xml.XmlNode > > > node) [0x0] > > > at NHibernate.Cfg.Configuration.AddValidatedDocument > > > (NHibernate.Cfg.NamedXmlDocument doc) [0x0] > > > --- End of inner exception stack trace --- > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Interception the sql
You can use Log4net to see what SQL is sent to the DB http://www.davesquared.net/2008/01/viewing-sql-generated-by-nhibernate.html On Wed, Jul 1, 2009 at 9:39 PM, Bruno Lima wrote: > Hello. > > Is there way to intercepting the sql that is sending to data base? > > I want to do like the EmptyInterceptor does with the Entities. > > Sorry, but I´m a newbie. > > Thank you. > > Bruno. > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Multi language implementation
The wiki is open for every registered user. On Wed, Jun 24, 2009 at 11:12 PM, Michal Gabrukiewicz wrote: > sure why not. > i guess i need some access to it ... > > best regards > michal -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TransientObjectException with legacy mapping
e_Fixture.CanAddNewModuleSuccessfully() >- Inner Stack Trace - >at System.Data.SqlClient.SqlConnection.OnError(SqlException > exception, Boolean breakConnection) >at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException > exception, Boolean breakConnection) >at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning > (TdsParserStateObject stateObj) >at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, > SqlCommand cmdHandler, SqlDataReader dataStream, > BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject > stateObj) >at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String > methodName, Boolean async) >at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery > (DbAsyncResult result, String methodName, Boolean sendToPipe) >at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() >C:\Dev\nhibernate-trunk\nhibernate\src\NHibernate\Tool\hbm2ddl > \SchemaExport.cs(146,0): at > NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1 scriptAction, > Boolean export, Boolean format, Boolean throwOnError, TextWriter > exportOutput, IDbCommand statement, String sql) >C:\Dev\nhibernate-trunk\nhibernate\src\NHibernate\Tool\hbm2ddl > \SchemaExport.cs(206,0): at > NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1 scriptAction, > Boolean export, Boolean justDrop, Boolean format, IDbConnection > connection, TextWriter exportOutput) >C:\Dev\nhibernate-trunk\nhibernate\src\NHibernate\Tool\hbm2ddl > \SchemaExport.cs(292,0): at > NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action`1 scriptAction, > Boolean export, Boolean justDrop, Boolean format) > > Note: I am using the NHibernate from the trunk (so 2.1.0Beta, I > believe) if this helps. > > I am a little confused because the mapping is generated fine and if I > work with just Variables and Relations then the entire object graph is > persisted. It seems weird to me but I'm an NHibernate newbie so if > someone can offer some help it will be greatly appreciated! > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate and .NET 4.0
Why ? The best way to know it is to run the whole suite of tests against the .Net x. But I think it's the same, and it will work ok. On Mon, Jun 22, 2009 at 6:32 AM, Graham Bunce wrote: > I'm thinking lazy loading not working properly or session > becoming corrupted somehow. Would the code run in different app > domains and cause problems? > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Handling Validator InvalidStateException within a Unit Of Work
Hard to recover from a validation exception at the very end of a request. Don't know if it's a good approach. On Fri, Jun 19, 2009 at 8:28 PM, Gary Brunton wrote: > > @Dario, > The flush/commit is taking part at the very end of the request and not > in my business/service code. It is automatic and happens always. > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Handling Validator InvalidStateException within a Unit Of Work
In what moment the flush/commit is taking part ? At the very ending of the request or in your business/service code ? On Fri, Jun 19, 2009 at 5:04 PM, Gary Brunton wrote: > > I'm not so sure I was very clear in explaining my problem. > Essentially the NHibernate session gets flushed/committed from an > HttpModule on every page request so if the session contains an invalid > entity, an InvalidStateExpection will be thrown. > > What I've decided to do is just clear the NHibernate session if a > validation error is found from an entity that was retrieved from the > repository (not newed up) and had a field set to an invalid value. > This way when the session gets flushed/committed it won't contain the > invalid entity. > > > Now I'm not sure that this expatiation is any better but I wanted to > update what I've decided just in case this does make sense to someone. > > Thanks! > Gary Brunton > > > > > On Jun 17, 4:18 pm, Fabio Maulo wrote: > > If you need to validate in some other point you can implements others > > listeners but, in general, the validation happen in some other > high-level. > > 2009/6/17 Gary Brunton > > > > > > > > > > > > > I just started looking into NHibernate.Validator and love the > > > integration it has with NHibernate. I do have a question though. > > > > > I see many examples of how to perform validation using NHV on a newly > > > created entity like so: > > > > > Customer customer = new Customer(); > > > ... > > > customer.Phone = "343-343-343"; //INVALID VALUE > > > customer.Zip = "34334"; //INVALID VALUE > > > > > ValidatorEngine validator = new ValidatorEngine(); > > > > > if (validator.IsValid(customer)) > > > { > > > repo.Save(customer); > > > } > > > > > But I can't find an example of performing validation on an entity > > > retrieved from a repository and then updated. ex: > > > > > Customer customer = repo.Get(1); > > > ... > > > customer.Phone = "343-343-343"; //INVALID VALUE > > > > > foreach (InvalidValue error in validatorEngine.Validate(customer)) > > > { > > > // display the errors... > > > } > > > > > from here I can retrieve the validation errors no problem but the > > > customer entity is now dirty and my unit of work will try to flush/ > > > commit the changes which causes an InvalidStateException. I don't > > > want to handle this exception here as it is assumed I've already > > > realized the entity is invalid and handled the validation errors as > > > desired. > > > > > Now from here I see a couple of options that I don't like: > > > 1. I could swallow all InvalidStateExceptions > > > 2. I could set some global error state when a validation error has > > > been found by the validation engine and then always check this global > > > error state before flushing/committing within my UOW. > > > > > Am I missing something here? > > > > > Any insight would be greatly appreciated. Thanks! > > > > > Gary Brunton > > > > -- > > Fabio Maulo > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Plug into SQL Logging
You can use https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate.Test/SqlLogSpy.cs Also you can play with Log4Net putting code around your actions, and see what the log is raising. Like: public void SomeTest() { using (new SqlLogSpy()) { log.Debug("Is going to Get()"); var person = session.Get(12345); log.Debug("Get() executed"); } } Or You can use statistics to count queries https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate.Test/Stats/StatsFixture.cs On Mon, Jun 1, 2009 at 1:20 AM, dnagir wrote: > > Hi, > > I want to play with NH a bit in my tests to ensure I get the expected > SQL statements. > So I want to write code like this: > > > public void SomeTest() { > // Something here... > using (var sqlTracker = new TrackSql(session)) { >var person = session.Get(12345); >Assert.AreEqual(1, sqlTracker.TotalQueries); > } > // Something there... > } > > > The code above is just simple case but the general aim is to check > what queries have been executed. > Can you suggest me a starting point for the TrackSql class? What > interfaces should I implement (IInterseptor doesn't look like the > correct one)... > > Thanks, > Dmitriy. > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Starting to contribute with Nhibernate.
Hi Placido. There isn't such manual. You can start with http://jira.nhforge.org If you don't get where to start to fix a bug, maybe sending an email the people can help you. Cheers On Mon, Jun 1, 2009 at 12:00 AM, Plácido Bisneto wrote: > Is there any manuals to people who wants to start contributing to the > project?I want to help you people, sharing some code too.. but I never > worked out with any open source project. > Thanks! > > -- > Plácido Bisneto > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Lazy loading and static/no proxy
Nowadays, I was looking the possibility to use Linfu2.2, and also I was talking close to Philip Laureano about the new stuff in 2.2 version. The think is, LinFu 2.2 is using Cecil to modify assemblies at runtime, then, modifying (weaving) types in runtime. The problem we are facing is this: Foo instance = (Foo)Activator.CreateInstance(modifiedType); We are not being able to cast the modified type into our entity (the original one). The problem relies that in .Net there isn't exists the concept of ClassLoader from Java, so we are not able to instrument the types in runtime. But, now we found this link, so maybe it can help to do the job http://stackoverflow.com/questions/185836/equivalent-of-class-loaders-in-net Cheers On Fri, May 29, 2009 at 9:46 AM, Fabio Maulo wrote: > with PostSharp and Cecil.But a lot of work to do and everybody should use > Postsharp. > payment = loadedPayment as ICreditCard; > if (payment != null) > { > . > } > > In the mapping you can use the interface as proxy. > Another option is disable lazy loading (lazy="false") for that specific > class. > > Another is > var cc = session.Get(payment.Id); > > Obviously I prefer > Program to interface not to implementation > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Lazy loading and static/no proxy
You can have a look to this: http://nhforge.org/wikis/proxygenerators10/default.aspx On Thu, May 28, 2009 at 3:40 AM, dnagir wrote: > > Hi, > > Is it possible to have lazy loading without generating Proxy classes > at runtime? > > Also, guys, maybe you know anything about static proxy? > Ayende did implement some bits a long time ago (poor Man, he was doing > it late in the night) but since than I cannot see anybody using it. > > I don't even mind to write additional code in getter/setter to enable > lazy loading (like LightSpeed requires), but not sure if NH can pick > that. > > Thanks, > Dmitriy. > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate validator and DI
On Tue, May 26, 2009 at 8:35 AM, Zihotki wrote: > > Is there any sample of using custom validators which depends on data > in database? For example a validator which checks whether the email of > user is unique. That I recall there isn't. But you can build your own custom validator and make the database call in there. http://nhforge.org/blogs/nhibernate/archive/2009/05/18/nhibernate-validator-quickstart.aspx > And is this possible to use dependency injector with validators? I don't know what do have in mind about this. There are plans/ideas to do something around this topic. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate Validator custom IMessageInterpolator
Ops, you're right ..he said is using 1.0 and I'm distracted On Thu, May 21, 2009 at 10:19 PM, Fabio Maulo wrote: > > That is not the NHV-Loquacious... that is the standard programmatic conf. > (he is using the previous version of NHV). > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate Validator custom IMessageInterpolator
Unique configuration: just set the configuration for NHV in one place. Or use app.config Or use nhvalidator.cfg.xml Or programatically (like the fluent code you sent me) On Thu, May 21, 2009 at 10:01 PM, Craig van Nieuwkerk wrote: > > What do you mean by a unique configuration? I will create a test on > the weekend with a standalone test cases if I can't get it working. > > Craig. > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate Validator custom IMessageInterpolator
You should use a unique configuration. If you prefer using Fluent remove the one is on the app.config/web.config. Would be nice to see a testcase to reproduce the issue. On Thu, May 21, 2009 at 9:20 PM, Craig van Nieuwkerk wrote: > > ValidatorEngine ve = new ValidatorEngine(); > NHVConfiguration nhvc = new NHVConfiguration(); > nhvc.Properties[Environment.MessageInterpolatorClass] = > typeof(CustomMessageInterpolator).AssemblyQualifiedName; > ve.Configure(nhvc); > > I am using Fluent nHibernate as well and this code is immediately > after the configuration for that. > > Craig > > On Fri, May 22, 2009 at 10:14 AM, Dario Quintana > wrote: > > Can you show me your NHV configuration code ? > > > > On Thu, May 21, 2009 at 8:28 PM, Craig van Nieuwkerk > > wrote: > >> > >> I am using Version 1.0.0GA. There is no error or stacktrace, the > >> Custom IMessageInterpolator is just never called. It does get > >> registered and constructed because if I put a breakpoint in the > >> constructor it is called, but none of the other methods seems to get > >> called from then on and the DefaultMessageInterpolator is always used. > >> > >> Craig. > >> > >> On Fri, May 22, 2009 at 2:49 AM, Dario Quintana > >> wrote: > >> > Which version of NHV ? > >> > Can you give us an error or stacktrace ? > >> > > >> > On Thu, May 21, 2009 at 10:38 AM, Craig van Nieuwkerk > >> > > >> > wrote: > >> >> > >> >> Has anyone managed to get a custom IMessageInterpolator working to > >> >> enable customisation of error messages. I have tried following the > >> >> instructions on this web page but to no avail. > >> >> > >> >> > >> >> > http://codelog.climens.net/2009/03/04/nhibernate-validator-custom-messages/ > >> >> > >> >> Looking into the code the DefaultMessageInterpolator seems pretty > >> >> baked into the framework so is there anything I am missing. > >> >> > >> >> Craig > >> >> > >> >> > >> >> > >> > > >> > > >> > > >> > -- > >> > Dario Quintana > >> > http://darioquintana.com.ar > >> > > >> > > > >> > > >> > >> > >> > > > > > > > > -- > > Dario Quintana > > http://darioquintana.com.ar > > > > > > > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate Validator custom IMessageInterpolator
Can you show me your NHV configuration code ? On Thu, May 21, 2009 at 8:28 PM, Craig van Nieuwkerk wrote: > > I am using Version 1.0.0GA. There is no error or stacktrace, the > Custom IMessageInterpolator is just never called. It does get > registered and constructed because if I put a breakpoint in the > constructor it is called, but none of the other methods seems to get > called from then on and the DefaultMessageInterpolator is always used. > > Craig. > > On Fri, May 22, 2009 at 2:49 AM, Dario Quintana > wrote: > > Which version of NHV ? > > Can you give us an error or stacktrace ? > > > > On Thu, May 21, 2009 at 10:38 AM, Craig van Nieuwkerk > > > wrote: > >> > >> Has anyone managed to get a custom IMessageInterpolator working to > >> enable customisation of error messages. I have tried following the > >> instructions on this web page but to no avail. > >> > >> > http://codelog.climens.net/2009/03/04/nhibernate-validator-custom-messages/ > >> > >> Looking into the code the DefaultMessageInterpolator seems pretty > >> baked into the framework so is there anything I am missing. > >> > >> Craig > >> > >> > >> > > > > > > > > -- > > Dario Quintana > > http://darioquintana.com.ar > > > > > > > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate Validator custom IMessageInterpolator
Which version of NHV ?Can you give us an error or stacktrace ? On Thu, May 21, 2009 at 10:38 AM, Craig van Nieuwkerk wrote: > > Has anyone managed to get a custom IMessageInterpolator working to > enable customisation of error messages. I have tried following the > instructions on this web page but to no avail. > http://codelog.climens.net/2009/03/04/nhibernate-validator-custom-messages/ > > Looking into the code the DefaultMessageInterpolator seems pretty > baked into the framework so is there anything I am missing. > > Craig > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Validation question
Yes with a class-validator, this means, i.e: using Attributes configuration, the attribute [MyDateRangeValidator] has to be on top of the class. On Fri, May 15, 2009 at 10:00 AM, mantzas wrote: > > Hi, > > can a validation rule be based on the value of another property? > > example Start Date <= End Date?? > > > Thx > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
Oh, sorry guys I forgot to catch up with you all. The problematic behaviour was reverted, we still being a new option to map time against TimeSpan. Here we have some doc for the matter http://nhforge.org/blogs/nhibernate/archive/2009/03/11/nhibernate-and-ms-sql-server-2008-date-time-datetime2-and-datetimeoffset.aspx On Mon, Apr 27, 2009 at 3:27 PM, Dave Smits wrote: > > stupid question, i use this the new feature on program that i build on > the old version. Now having problems with this change; where can i > found more information about this? is there any documentation (like > the changelog.txt, where can i find them?) gr dave -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHContrib default.build
I think you can't do it, try building the project you need individually. On Mon, Apr 20, 2009 at 3:02 PM, dagda1 wrote: > > Hi, > > I am trying to build the enitre of nhcontrib from the default.build > file at the root of the src folder which will build all the individual > projects. > > It fails pretty quickly. > > Can anyone tell me which switches and tasks I should call to enable > the build to work. > > If I enter the following command: > > nant -t:net-3.5 > > It does not get very far. > > All the individual default.build files seem to work fine but I would > like to be able to build the whole contrib folder from one nant build. > > Is this possible? > > Thanks > > Paul > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Validator custom message
${propertyname} is a new way to interpolate with NHV. It will interpolate the value of the property into your message, the property exists into your entity. PropertyWithMessage is a property into your entity with the message, is the only way you can override the default message, like I said, is a workaround (a dirty one) for what you're looking for. Config as *UseExternal*, was a breaking change, there are post at nhforge.org blogs. On Sat, Apr 18, 2009 at 12:50 PM, Lars Zeb wrote: > Dario, > > > > Thanks for the reply and your contribution to Validator. > > > > Can you be more specific about using ${PropertyWithMessage}? Does it go in > the Validator’s Attribute class? Where does the PropertyWithMessage property > itself go, in the class being validated? Sorry, I am lost. > > > > I downloaded the alph3 source. When I run the app, it throws an exception. > What have I done wrong? > > > > Lars > > > > NHibernate.Validator.Exceptions.ValidatorConfigurationException was > unhandled > > Message="Unexpected ValidatorMode :UseXml" > > Source="NHibernate.Validator" > > StackTrace: > >at > NHibernate.Validator.Cfg.CfgXmlHelper.ValidatorModeConvertFrom(String > validatorMode) in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Cfg\CfgXmlHelper.cs:line > 78 > >at > NHibernate.Validator.Engine.ValidatorEngine.Configure(INHVConfiguration > config, IMappingLoader mappingLoader) in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Engine\ValidatorEngine.cs:line > 209 > >at > NHibernate.Validator.Engine.ValidatorEngine.Configure(INHVConfiguration > config) in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Engine\ValidatorEngine.cs:line > 186 > >at NHibernate.Validator.Engine.ValidatorEngine.Configure(XmlReader > configReader) in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Engine\ValidatorEngine.cs:line > 171 > >at NHibernate.Validator.Engine.ValidatorEngine.Configure(String > configFilePath) in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Engine\ValidatorEngine.cs:line > 151 > >at NHibernate.Validator.Engine.ValidatorEngine.Configure() in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\src\NHibernate.Validator\Engine\ValidatorEngine.cs:line > 137 > >at NHibernate.Validator.Demo.NHI.Program.TryToSaveAnInvalidEntity() > in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\examples\Integration\NHibernate.Validator.Demo.NHI\NHibernate.Validator.Demo.NHI\Program.cs:line > 43 > >at NHibernate.Validator.Demo.NHI.Program.Main() in > E:\Development\NHibernate.Validator-1.2.0.Alpha3-src\examples\Integration\NHibernate.Validator.Demo.NHI\NHibernate.Validator.Demo.NHI\Program.cs:line > 17 > >at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] > args) > >at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence > assemblySecurity, String[] args) > >at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > >at System.Threading.ThreadHelper.ThreadStart_Context(Object state) > >at System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object state) > >at System.Threading.ThreadHelper.ThreadStart() > > InnerException: *From:* nhusers@googlegroups.com [mailto: > nhus...@googlegroups.com] *On Behalf Of *Dario Quintana > *Sent:* Wednesday, April 15, 2009 2:40 PM > *To:* nhusers@googlegroups.com > *Subject:* [nhusers] Re: NHibernate Validator custom message > > > > Hi > > Right now I think you can't do that, for that matter, but I have something > in mind. Will review this later. > > Maybe you can workaround this using the NHV1.2(alpha but stable) doing > something like this: > > "${PropertyWithMessage}" > > And your class has a property *PropertyWithMessage* as string. I know is > dirty, but will solve your problem till we implement a better solution > (think BeanValidation -java- calls it: Validation Context, so you can add > errors to the current context). > > Cheers > > On Wed, Apr 15, 2009 at 5:55 PM, Lars Zeb wrote: > > > I have created a customer class validator and it works OK. Using third- > party software, it validates a postal address. This address validator > uses Address, City, State and Zip properties. > > Instead of having the validator message associated with the class, I > would like to have it associated with the Address property's mess
[nhusers] Re: Mono
Officialy, there isn't a committer in charge of this matter. Nobody is taking care about compatibilities issues, in case they exists. Unofficialy, I think there are companies working with NH+Mono http://nhforge.org/wikis/successstories/success-stories.aspx On Wed, Apr 15, 2009 at 6:28 PM, Andrew Smith wrote: > > Does NHibernate officially support mono? > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Validator custom message
Hi Right now I think you can't do that, for that matter, but I have something in mind. Will review this later. Maybe you can workaround this using the NHV1.2(alpha but stable) doing something like this: "${PropertyWithMessage}" And your class has a property *PropertyWithMessage* as string. I know is dirty, but will solve your problem till we implement a better solution (think BeanValidation -java- calls it: Validation Context, so you can add errors to the current context). Cheers On Wed, Apr 15, 2009 at 5:55 PM, Lars Zeb wrote: > > I have created a customer class validator and it works OK. Using third- > party software, it validates a postal address. This address validator > uses Address, City, State and Zip properties. > > Instead of having the validator message associated with the class, I > would like to have it associated with the Address property's message. > And this message has about 500 variations depending on what error the > third-party software finds, so I need to assign the Message property > of Address at run time. > > Is this possible? > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Burrows and Validator
On Tue, Apr 14, 2009 at 7:54 PM, cws wrote: > > In order to write some test for this: > - If I got it correct > this .IntegrateWithNHibernate.ApplyingDDLConstraints will apply > constraints like notnull, length and even unique,index, unique-key? > - Two listeners will be attached for the events preupdate and > preinsert? Yes. > Another question: > Are there any plans of updating burrows for latests nh? I have done it > locally, but I am not a commiter yet. Is there some docs of how to > comit to these excellent projects? Docs, none.For the last NH release, be patience, maybe a patch will appear on these days :-) -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Burrows and Validator
I think it's. IConfigurator is a request I did to Kailuo in order to intercept the configuration for this kind of stuff. On Tue, Apr 14, 2009 at 10:23 AM, cws wrote: > > Hi! > > Trying to configure a Nhibernate project using Burrows and fluent- > Validator. > > I do this like this > > public class NHibernateMapping : IConfigurator >{ > >#region IConfigurator Members > >public virtual void Config(IBurrowConfig val) >{ >} > > >public virtual void Config(IPersistenceUnitCfg puCfg, > Configuration nhCfg) >{ >ValidatorEngine ve = > NHibernate.Validator.Cfg.Environment.SharedEngineProvider.GetEngine(); > >var configure = new FluentConfiguration(); >string assembly = "Skolplatsen.BLL"; >configure.Register( >Assembly.Load(assembly) >.ValidationDefinitions() >.Where(t => t.Namespace.Equals(string.Format > ("{0}.Validators", assembly))) >) >configure >.SetDefaultValidatorMode > (ValidatorMode.UseExternal).SetMessageInterpolator > () >.IntegrateWithNHibernate.ApplyingDDLConstraints > ().And.RegisteringListeners(); > ve.Configure(configure); > } > > Using burrow's customconfigurator and own sharedengine. Is this the > right way to set it up? > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Validators Questions
I don't know how you're able to use the new features of interpolation of NHV with xVal, but repeat, I'm not so sure, investigate. I.e:. Now in NHV you can write a custom message like: "The Customer with Id: ${Id} has a Name with no valid length: Valid Leng {Min} till {Max}" On Mon, Apr 13, 2009 at 4:07 PM, shapper wrote: > > > > On Apr 13, 7:20 pm, Dario Quintana > wrote: > > Seems like xVal integrate NHV and xVal to use it with Asp.Net MVC, but > you > > should have a look what is going on in background: > https://xval.svn.codeplex.com/svn/RulesProviders/NHibernateValidator/... > > Is it bad? You wrote as a warning ... Something not well done? > > > Seems like is providing client&server side validation for NHV, I should > > check this deeper. > > Yes, that is why I am really considering XVal ... it allows me to use > Client validation with JQuery which I already use. > > > Also few days ago, I wrote this entry in how to integrate MVC with NHV, > this > > is just server-side validation, but works fine. > http://nhforge.org/blogs/nhibernate/archive/2009/04/02/nhibernate-val... > > Suggestions are welcome. > > I found that blog post earlier today. > A question: where would you put specific validation not possible with > the Class Property Annotations? > > Thanks, > Miguel > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate Validators Questions
Seems like xVal integrate NHV and xVal to use it with Asp.Net MVC, but you should have a look what is going on in background: https://xval.svn.codeplex.com/svn/RulesProviders/NHibernateValidator/NHibernateValidatorRulesProvider.cs Seems like is providing client&server side validation for NHV, I should check this deeper. Also few days ago, I wrote this entry in how to integrate MVC with NHV, this is just server-side validation, but works fine. http://nhforge.org/blogs/nhibernate/archive/2009/04/02/nhibernate-validator-and-asp-net-mvc.aspx Suggestions are welcome. On Mon, Apr 13, 2009 at 8:02 AM, shapper wrote: > > Hello, > > I am using ASP.NET MVC and I would like to use NHibernate Validators > on my projects together with XVal (http://blog.codeville.net/ > 2009/01/10/xval-a-validation-framework-for-aspnet-mvc/<http://blog.codeville.net/%0A2009/01/10/xval-a-validation-framework-for-aspnet-mvc/> > ) > > - To use the NHibernate validators I only need to use the > NHibernate.Validator.dll assembly right? > - Where can I find a complete list of the validation types available? > (Length, CreditCard, etc). > > Thanks, > Miguel > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Session valid ?
IIRC, you cannot use a session after an exception, you have catch the exception, then you know the session is invalid. On Tue, Apr 7, 2009 at 8:40 AM, Kris-I wrote: > Hello, > > Is there a way to know if a session can be use or not after an exception > for example. > > If I check the session with IsDirty and create a new one depending of the > result ? > > Wich is the best way ? > > Thanks, > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Changing the connection string for a session factory
SessionFactory is readonly On Mon, Apr 6, 2009 at 7:28 AM, dagda1 wrote: > > Hi, > > I will be running in the context of a session factory. > > I have a number of clients connecting to the same windows service via > MSMQ. > > The service will update a particular database. Each client has its > own specific database with exactly the same schema, > > I want to use the Nhibernate Castle.Facility.NhiberntateIntegration > facility. > > I am trying to avoid having a seperate sessionfactory for each > client. We could have potentially 40 clients. > > I am wodering if there is a way to change the SessionFactory > connection string at run time? > > I need to change the connection string after the session factory has > been initialised or every time the windows service receives a request > from MSMQ. > > Do you think this is possible? \ > > if not, is there another approach I can take? > > Thanks > > Paul > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Disable all ID generators
Before reading from your mappings you can get the PersistentClass of your entity and manage it as you wish.Something like: cfg.GetPersistentClass(typeof(MyEntity)).Identifier And here will have to investigate which are suitables for "assigned". After that, you can BuildSessionFactory();. On Sun, Apr 5, 2009 at 11:44 PM, Stefan Sedich wrote: > > Hello, > > Would there be a way in code to disable all the ID generators? I am > using XML mapping with guid.comb generators, but I would like to > change them all to assigned for a moment while I insert some test > data. > > > > Cheers > > -- > Stefan Sedich > Software Developer > http://weblogs.asp.net/stefansedich > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Removal of Proxy Dependencies
Right now, seems a matter of taste, or how easy/fast we can configurate our NH-app (the first link of this post point to this) But... looking to this... http://gustavoringel.blogspot.com/2009/03/unhaddins-sessionwrapper-and.html Seems like there is something else :-) On Thu, Apr 2, 2009 at 8:52 AM, Stefan Steinegger wrote: > > We are using Spring, DynamicProxy and Rhino Mocks (using Dynamic > Proxy). I have to admit that I still don't have any clue which proxy > system to choose. There are some problems with DP I could solve by > compiling Rhino. Switching to LinFu might be even easier. But what are > the actual differences of these proxy systems? > > Today it's kind of "It doesn't matter, just pick one by random". > Fabio, you're talking about different features. Can I benefit from > them somehow, when using NHibernate? Are there differences in > scalability, performance, limitations, whatever? Of course everyone > can read the documentation of all the proxy implementations and try to > make a comparison himself - just to find out that it really doesn't > matter for his case. > > It would be a great topic for a blog, some rules of thumb which proxy > system to choose if you don't have a clue. So if someone has the > knowledge and time to write such an article, it would be very > appreciated. > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: composite validation with nhibernate validator?
You create an interface: interface HasPass { string Pass{get;set;} string PassConfirm {get;set;} } Then in your validator you cast against the interface, then your validator is "more generic". On Mon, Mar 30, 2009 at 8:51 AM, James Crowley wrote: > Thanks Gustavo! Is there any way to make this a little more generic so you > can reuse the validator across different objects? Ideally I'd like to do > something like this: > > [AreEqual("GroupName")] > public string SomeProperty { ... } > > [AreEqual("GroupName")] > public string SomeProperty { ... } > > but there doesn't seem to be a way to get the class instance from a > property-level attribute? > > Thanks > > James > > 2009/3/30 Gustavo Ringel > >> you can create a class attribute for this. Check the AssertAnimalAttribute >> in tests, you can easily get the animal there and check if two properties >> are the same. >> >> Gustavo. >> >> >> On Mon, Mar 30, 2009 at 1:58 PM, James Crowley >> wrote: >> >>> Is there any way to set up composite validation? For instance, on a UI >>> object that has "Password" and "PasswordConfirm", and they need to both >>> equal the same value? >>> >>> I've seen this in other frameworks, but not nhibernate validator? >>> >>> Thanks >>> >>> James >>> >>> >>> >> >> >> > > > -- > James Crowley > Managing Director > Developer Fusion - Connecting developers worldwide > > Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH > mob: 07986 624128 web: http://www.developerfusion.com/ > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NH Spatial compatible with NH2.1
You can ask by a ticket here: http://nhjira.koah.net/browse/NHSP On Thu, Mar 26, 2009 at 12:47 PM, Bruno wrote: > > Same question... > > On 20 fev, 08:39, stachu wrote: > > Hi! > > I found NHSpatialvery interesting and promesing. I wanted to give it > > a try but I noticed that it's build against NH2.0.1. However at work > > we use NH2.1 and it tried to build NHSP with it but it failed. My > > question is if you are planning to upgrade it in near future? > > Best regards > > Mike > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: DB comments and description in NHibernate
I didn't say that.Since NHMA use the mapping schema to generate the attributes, the option should be there. Maybe after the definition maybe your class will be having more metadata than code. On Thu, Mar 26, 2009 at 10:21 AM, Utopico wrote: > > So it is a feature in the hbm-languague definition but not as > attributes? If so is it possible to add this feature to the attributes > in an "easy" way? > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: DB comments and description in NHibernate
Should be something like this in hbm-language To a table: my customer comment here ... To a column: My Name comment here You should extrapolate this to those attributes, since are generated by the NH-schema, should be supported. The dialects with the option enabled are Oracle8iDialect on forward. On Thu, Mar 26, 2009 at 6:47 AM, Utopico wrote: > > I am working on a project where the database should be documented. I > am looking for a way to use hibernate to define this in hibernate. I > am using attributes on my classes to define my database (an example > can be seen below). > >[NHibernate.Mapping.Attributes.Class(Table = "LINK")] >public partial class Link >private Int32 _id; >[NHibernate.Mapping.Attributes.Id(Name = "Id", Column = "ID")] >[NHibernate.Mapping.Attributes.Generator(1, Class = > "sequence")] >[NHibernate.Mapping.Attributes.Param(2, Name = "sequence", > Content = "LINK_ID_SEQ")] >public virtual Int32 Id >{ >get >{ >return this._id; >} >set >{ >this._id = value; >} >} > } > ... > } > > > What I am looking for is something like: > >[NHibernate.Mapping.Attributes.Class(Table = "LINK", > Description="This is a table that keeps track of my links")] >public partial class Link > > and > >[NHibernate.Mapping.Attributes.Param(2, Name = "sequence", > Content = "LINK_ID_SEQ", Description="This is my primary key > automatically generated by sequence number.")] >public virtual Int32 Id > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
To @Roger and @Jay: I don't have complains to vote for "who" is the default. We were asking to the community for that, the point was that we got any answer. But "who is default" is another issue in the Jira. Cheers. -- Dario Quintana --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
On Wed, Mar 25, 2009 at 1:46 PM, Roger Kratz wrote: > I’ve uploaded a patch to the JIRA which makes my tests pass. > Roger, The patch partially applied r4154. A brief summary of what NH is supporting right now about this matter to manage *duration*: 1- The "TimeSpan" in the mapping, means: an hour from 00.00.00 to 23.59.59. Is mapped directly to a DbType.Time. Actually this it's not duration, it's a moment of the day, could not be negative or +24hs. In SqlServer2005 means a DateTime. We use the BaseDate to deal with the Date part in the RDBMS. In SqlServer2008 means a Time. 2- The "TimeSpanInt64" in the mapping means a duration of something, and the range is the same of Int64. Could be < 0h, > 24h. In SqlServer2005/2008 means a BigInt. 3- If you want to use "time" NHibernate type, then you've to use System.DateTime in your C# code. But it's messy to deal with a DateTime to manage a duration. I hope this clarify the situation. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
On Wed, Mar 25, 2009 at 1:47 PM, Jay Chapman wrote: > I don't agree with this statement at all. Hasn't the System.TimeSpan > existed for a much longer time than Sql.Time? So how could it possibly be > an offer to support Sql.Time when that didn't exist? > Which one? I don't know what you mean with this, but, we added a new features, we didn't remove one. > I can say for sure that I have used TimeSpan in the past for tracking > things like the amount of time it'll take to travel from point A to point B. > That's something which is very different than Sql.Time, so should it not be > supported? > Who say we are not giving support? Please read from the beginning, the point is: TimeSpan NHibernate type was moved to TimeSpanInt64. > It seems like the goal should be able to take a value, save it, load it > back and still have the same value, regardless of what the common usage is. > There are plenty of applications that use it correctly, but in a different > way. > Yes, that's why in the release notes it's said in the breaking change stuff. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Using NHibernate.Validator
Yes Fabio, it's true, we don't have a Bean-Validator example :( Would be nice if a good soul (or a soul with a little of spare time) can write the wiki entry. On Wed, Mar 25, 2009 at 12:07 PM, Fabio Maulo wrote: > Dario, I think our friend are talking about a "Bean-Validator" and we don't > have a public example... we should write something about it in somewhere. > First a blog-post and a wiki after feed-back would be fine. > > 2009/3/25 Dario Quintana > >> Hi, you've something here: >> >> For NH 1.0 >> http://nhforge.org/wikis/validator/default.aspx (for a Custom Validator >> see: Writing your own constraints). >> >> And For NH 1.2 (yet alpha2 but very stable) >> >> http://nhforge.org/blogs/nhibernate/archive/2009/02/18/nhibernate-validator-fluent-interface-configuration.aspx >> >> http://nhforge.org/blogs/nhibernate/archive/2009/02/26/diving-in-nhibernate-validator.aspx >> >> On Wed, Mar 25, 2009 at 10:34 AM, Vels wrote: >> >>> >>> Hi.. >>> can anyone tell how to impliment NHibernate.Validator ? >>> where can i get sample code for custom nHibernate validator ? >>> >>> -vels- >>> >>> >>> >> >> >> -- >> Dario Quintana >> http://darioquintana.com.ar >> >> >> >> > > > -- > Fabio Maulo > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
System.TimeSpan is what .Net offers to match a Sql.Time. There is no real discussion about the 1657 since nobody showed interest. The reason of these changes are the types introduces on .Net 2 Sp1 On Wed, Mar 25, 2009 at 1:22 PM, Oskar Berggren wrote: > To me it seems quite weird that a CLR TimeSpan by default be stored as a > sql TIME, since they are conceptually different things. And with the wildly > different ranges there is as seen a practical difference too. > > I can find no real discussion on this change in NH-1657 and in the mail > archives, though it was mentiond on Feb 5th. What is the reasoning behind > this move? Has anyone actually requested this change? > > /Oskar > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[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 wrote: > Im using sql2005 dialect. (no explicit type in mapping file -> datetime > column) > > > > Whatever I persist… > > Assert.AreEqual(orgObj.MyTimeSpan, readObj.MyTimeSpan) > > …always fails due to the timespan have different number of days. They > differ with some ten thousand days ;) > > > > I can (try to) create a patch 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 > wrote: > > IMHO – even with timespan between 0 and 24h, current impl give strange > results. As shown in attached jira tests, the timespan read has incorrect > days (even when timespan between 0 and 24h). Timespan persisted != timespan > read. Earlier nh tests only confirmed that hour, minutes and seconds > properties of the timespan are the same. > > BTW, what dialect are you using ? > When you're using TimeSpan, which match to an SqlServer Time type, you > can't talk about days, are completed ignored, you've to talk about hours, > minutes, seconds. > > I got passing VerifyDaysShouldBeZeroInSmallTimeSpan test. > > -- > Dario Quintana > http://darioquintana.com.ar > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
I think Roger knows that because in the test he said the tests are passing with that type. Then you've to use TimeSpanInt64 to handle more than 24 hr, and less than 0. The breaking change it's already added on the notes. On Wed, Mar 25, 2009 at 1:13 PM, Fabio Maulo wrote: > Don't forget that the previous impl is there TimeSpanInt64.Dario, please > add the BREAKING CHANGE to releasenotes.txt > Thanks. > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
Roger, hi On Wed, Mar 25, 2009 at 1:03 PM, Roger Kratz wrote: > IMHO – even with timespan between 0 and 24h, current impl give strange > results. As shown in attached jira tests, the timespan read has incorrect > days (even when timespan between 0 and 24h). Timespan persisted != timespan > read. Earlier nh tests only confirmed that hour, minutes and seconds > properties of the timespan are the same. > BTW, what dialect are you using ? When you're using TimeSpan, which match to an SqlServer Time type, you can't talk about days, are completed ignored, you've to talk about hours, minutes, seconds. I got passing VerifyDaysShouldBeZeroInSmallTimeSpan test. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: TimeSpan >24h or <0h
The idea of TimeSpan is use for example on SqlServer2008 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 wrote: > Done > > http://nhjira.koah.net/browse/NH-1715 > > > > > > *From:* nhusers@googlegroups.com [mailto:nhus...@googlegroups.com] *On > Behalf Of *Fabio Maulo > *Sent:* den 25 mars 2009 14:09 > *To:* nhusers@googlegroups.com > *Subject:* [nhusers] Re: TimeSpan >24h or <0h > > > > JIRA please with a very little NUnit test (see the "Welcome" on our JIRA > home page if you never sent a NUnit test to us). > > Do it ASAP 2009/03/29 is the day of Alpha2 > > 2009/3/25 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 it’s by design to not work outside 0-24h, I would prefer an > exception rather than wrong result. > > > > /Roger > > > > > > > > > -- > Fabio Maulo > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Using NHibernate.Validator
Hi, you've something here: For NH 1.0 http://nhforge.org/wikis/validator/default.aspx (for a Custom Validator see: Writing your own constraints). And For NH 1.2 (yet alpha2 but very stable) http://nhforge.org/blogs/nhibernate/archive/2009/02/18/nhibernate-validator-fluent-interface-configuration.aspx http://nhforge.org/blogs/nhibernate/archive/2009/02/26/diving-in-nhibernate-validator.aspx On Wed, Mar 25, 2009 at 10:34 AM, Vels wrote: > > Hi.. > can anyone tell how to impliment NHibernate.Validator ? > where can i get sample code for custom nHibernate validator ? > > -vels- > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHibernate.XmlSerializers
when you enable the option to see all CLR exceptions, you will be notified of every exception thrown, whether be caught or not. Disable the option if you don't want to see the exceptions, or check just the excepcions you may want to see. In VS: "Debug" -> "Exceptions" -> "Common Language Runtime Exceptions" -> See the "Thrown" check On Mon, Mar 23, 2009 at 12:25 PM, dhtroy wrote: > > Ayende, > > Thanks for the fast response. Is there something he can do (i.e., > disable) to prevent this from showing up (other than kill off all the > MDAs)? > > Is there one particular MDA he can disabled so this no longer > displays? > > Thanks again. > > On Mar 23, 11:09 am, Ayende Rahien wrote: > > Just ignore this issue, it will be caught internally inside the xml > > serializer infrastructure > > > > On Mon, Mar 23, 2009 at 11:08 AM, dhtroy wrote: > > > > > We have a single developer that has started receiving the following > > > error message, when the call is issued to Configuration.AddAssembly(), > > > to add our mapping assembly. He has built the mapping assembly and > > > verified that it exists, physically, on his machine, and has performed > > > a clean and full solution rebuild, yet he continues to get this > > > error. > > > > > He disabled MDA's and this exception is no longer being thrown. > > > > > Can someone suggest a reason this is happening? > > > > > Exception Message: > > > > > The assembly with display name 'NHibernate.XmlSerializers' failed to > > > load in the 'LoadFrom' binding context of the AppDomain with ID 1. The > > > cause of the failure was: System.IO.FileNotFoundException: Could not > > > load file or assembly 'NHibernate.XmlSerializers, Version=2.0.1.4000, > > > Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its > > > dependencies. The system cannot find the file specified. > > > > > File name: 'NHibernate.XmlSerializers, Version=2.0.1.4000, > > > Culture=neutral, PublicKeyToken=aa95f207798dfdb4' > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NHBurrow works with NH 2.1.0 Alpha ?
Not yet On Fri, Mar 20, 2009 at 9:49 AM, Paulo Quicoli wrote: > Hi friends, > > it works with NH 2.1.0 Alpha ??? > > thanks > > -- > Paulo R. Quicoli > > Editor Técnico - ClubeDelphi Magazine - DevMedia > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: where is the source code for
try install nunit libs, then nant can run the unit tests On Thu, Mar 19, 2009 at 5:17 PM, epitka wrote: > > Can anybody confirm that checking out this branch and running nant > works? I really don't want to be modifing build files. > > On Mar 19, 2:39 pm, epitka wrote: > > I know, I can see them but runing nant generates this in log file > > > > common.compile-tests: > > > > [csc] Compiling 10 files to 'C:\Software > > \NHibernate2\branches\2.0.x\nhibernate\build\NHibernate-2.0.1.GA-debug > > \bin\net-3.5\Iesi.Collections.Test.dll'. > > [csc] c:\Software\NHibernate2\branches\2.0.x > > \nhibernate\src\Iesi.Collections.Test\Generic\HashedSetFixture.cs > > (7,7): error CS0246: The type or namespace name 'NUnit' could not be > > found (are you missing a using directive or an assembly reference?) > > [csc] c:\Software\NHibernate2\branches\2.0.x > > \nhibernate\src\Iesi.Collections.Test\Generic\ImmutableSetFixture.cs > > (4,7): error CS0246: The type or namespace name 'NUnit' could not be > > found (are you missing a using directive or an assembly reference?) > > [csc] c:\Software\NHibernate2\branches\2.0.x > > \nhibernate\src\Iesi.Collections.Test\Generic\SetFixture.cs(4,7): > > error CS0246: The type or namespace name 'NUnit' could not be found > > (are you missing a using directive or an assembly reference?) > > > > On Mar 19, 2:34 pm, Dario Quintana > > wrote: > > > > > From where are you taking the code, the libs are right there. > > > > > On Thu, Mar 19, 2009 at 4:30 PM, epitka > wrote: > > > > > > And it cannot build because it is missing reference to NUnit. > Arrggghh > > > > > -- > > > Dario Quintanahttp://darioquintana.com.ar > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: where is the source code for
>From where are you taking the code, the libs are right there. On Thu, Mar 19, 2009 at 4:30 PM, epitka wrote: > > And it cannot build because it is missing reference to NUnit. Arrggghh > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Your own validator?
Use NHibernate.Validator, you can integrate it with NH. On Thu, Mar 19, 2009 at 4:30 PM, Oskar Berggren wrote: > From the reference manual I learn that I can let my entity classes inherit > from IValidatable, and thus prevent "invalid" instances from being > persisted. However, I don't want my domain objects to have a hard dependency > in NHibernate. Supposedly I can define a similar interface myself as part of > my domain layer or a very small support layer. But can I make NHibernate > pick up on this? Can I inject in some way my own "Validator" which can > examine each entity right before it's persisted and do it's thing? > > /Oskar > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: where is the source code for
You're looking for this: https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/branches/2.0.x/ 4000 means GA On Thu, Mar 19, 2009 at 3:59 PM, epitka wrote: > > ...But this is 2.1.0? I need 2.0.1.4000... -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Question about projections
Hi Here you've an example: http://unhaddins.googlecode.com/svn/trunk/Examples/uNHAddins.Examples.Course/YourPrjDomain/Transformers/ http://unhaddins.googlecode.com/svn/trunk/Examples/uNHAddins.Examples.Course/EntitiesNHPersistence.Tests/Transformers/TransformersFixture.cs Cheers On Wed, Mar 18, 2009 at 5:22 PM, Jan Van Ryswyck wrote: > > I have a question about using projections on collections. Suppose I > have the following domain classes: > > public class Catalog > { >public IEnumerable Categories { get; set; } >public String Name { get; set; } > } > > public class Category > { >public String Name { get; set; } > } > > that I want to project to the following DTO's: > > public class CatalogDTO > { >public IEnumerable Categories { get; set; } >public String Name { get; set; } > } > > public class CategoryDTO > { >public String Name { get; set; } > } > > The name property of the Catalog is quite easy, but I don't know how > to do the Categories: > > DetachedCriteria.For() >.CreateAlias("Categories", "categories") >.SetProjection(Projections.ProjectionList() > .Add(Projections.Property("Name"), > "Name")) >.SetResultTransformer(Transformers.AliasToBean(typeof > (CatalogDTO))); > > Should I create a ProjectionList inside the current ProjectionList for > the Categories? Any thoughts? Thanks in advance. > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Relation many to many only adds a record
Yes, you can talk portugues with Fabio, but in private, in this list, stick to english please, maybe what you're saying could be help to another user. On Wed, Mar 18, 2009 at 2:59 PM, Fernando Cruz wrote: > > Opa Fábio, acho que posso falar com você em português. Bom estou > usando a versão 2.0 do nhibernate e não a 2.1.0. O interessante que > tenho outro relacionamento igual ao que estou com problema que utilizo > idbag e funciona perfeitamente. Vou te falar meu problema, estou > desenvolvendo uma aplicação que irá rodar em 3 sgbds diferentes (Sql > Server, Oracle e Postgres) e pesquisando percebi que a única forma de > realizar um relacionamento de "muitos pra muitos" (many to many) sendo > que nesse relacionamento tenho um campo que é auto-incrementável, só > que no Oracle preciso associar esse campo a uma sequence, para obter o > próximo valor único. Bom obrigado até agora e espero que possa me > ajudar. > > On Mar 18, 2:05 pm, Fabio Maulo wrote: > > support of identity for is pretty new in NH2.1.0Alpha1 (Hibernate > > don't supports it).BTW what is strange in your mapping is the type of the > ID > > for the collection. > > If you can recreate the issue please use the JIRA attaching a test. > > Thanks. > > > > 2009/3/18 Fernando Cruz > > > > > > > > > > > > > Yes, use Sql Server 2005. > > > > > On Mar 18, 1:05 pm, Fabio Maulo wrote: > > > > RDBMS ? > > > > 2009/3/18 Fernando Cruz > > > > > > > I am using idbag (because I then user sequence) and has the > following > > > > > relationship: functionality ->> Permission <<- Profile. Here is the > > > > > mapping of the Feature table: > > > > > > > > > > > > > > lazy="true" assembly="ObjetoXP"> > > > > > > > > > table="tb_segu_funcionalidade" lazy="true"> > > > > > > > > > > type="Decimal"> > > > > > > > > > > > > > > > > > > > > > > > > > > class="ObjetoXP.SeguModulo,ObjetoXP" not-null="true" /> > > > > > > > > > > > > > > name="Descricao" not-null="true" /> > > > > > > > > > > > > > > > > lazy="true"> > > > > > > > > > > > > > > > > > > > > > > > > > > lazy="true" cascade="all" inverse="false"> > > > > > type="Decimal"> > > > > > > > > > > > > > > > > > > > > > > > > column="perf_ch_perfil" outer-join="true"/> > > > > > > > > > > > > > > > > > > > > > > > > Precisely the idbag not working properly. I try to insert two > elements > > > > > from the feature list and only insert a ListaFuncPerm. The > interesting > > > > > thing is that if I use the bag with mapping works correctly. > > > > > > -- > > > > Fabio Maulo > > > > -- > > Fabio Maulo > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] NHForge back to the normality
Hi all Nowadays NHForge had suffer infrastructure problems (RDBMS involved) and today went offline for a few hours to apply a patch, moving to NHForge to the last version of Community Server. All these problems are fixed, now is online and updated. Thanks for your patience and enjoy it, it's for you! Cheers -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Should I throw NHibernate.Validator.Exceptions.InvalidAttributeNameException?
Oh, sorry, now I get it. Maybe you should validate as "false" if you are really expecting a type, but don't throw an exception. On Tue, Mar 17, 2009 at 5:19 PM, Brendan Erwin wrote: > > I'm creating a custom Validator that should only be applied to types > of DateTime and DateTime?. > > Is there an appropriate Validator exception for me to throw when I > detect an incompatible type? > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Should I throw NHibernate.Validator.Exceptions.InvalidAttributeNameException?
You have to throw the exception in the first line of your custom validator, there isn't other way On Tue, Mar 17, 2009 at 5:19 PM, Brendan Erwin wrote: > > I'm creating a custom Validator that should only be applied to types > of DateTime and DateTime?. > > Is there an appropriate Validator exception for me to throw when I > detect an incompatible type? > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Upgrade to 2.1.0.Alpha1 doesn't work with LinFu
Me too + own applications On Tue, Mar 17, 2009 at 11:02 AM, Fabio Maulo wrote: > We are using LinFu to run all NHibernate test without any kind of problem. -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate SetFirstResult & SetMaxResults Problems
Could you create a TestCase and send us ? Would be a great help to see the problem On Mon, Mar 16, 2009 at 11:49 PM, Craig van Nieuwkerk wrote: > > It could be related to this other problem from the other day that I > have yet to fix "Joined subclass problem". > > The sql in the log that is generated is. > > INFO 2009-03-17 12:49:00,183 27480ms Loader > GetResultSet - select author0_.id as id0_, author0_1_.name as > name0_, author0_.country as country2_ from author author0_ inner join > person author0_1_ on author0_.id=author0_1_.id > INFO 2009-03-17 12:49:00,183 27480ms Loader > GetResultSet - select author0_.id as id0_, author0_1_.name as > name0_, author0_.country as country2_ from author author0_ inner join > person author0_1_ on author0_.id=author0_1_.id > INFO 2009-03-17 12:49:00,226 27524ms Loader > GetResultSet - select borrower0_.id as id0_, borrower0_1_.name > as name0_, borrower0_.user_name as user2_1_ from borrower borrower0_ > inner join person borrower0_1_ on borrower0_.id=borrower0_1_.id > INFO 2009-03-17 12:49:00,226 27524ms Loader > GetResultSet - select borrower0_.id as id0_, borrower0_1_.name > as name0_, borrower0_.user_name as user2_1_ from borrower borrower0_ > inner join person borrower0_1_ on borrower0_.id=borrower0_1_.id > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: nHibernate SetFirstResult & SetMaxResults Problems
Into your log4net configuration you can paste this to see what actually NH is generating ... ... On Mon, Mar 16, 2009 at 11:01 PM, Craig van Nieuwkerk wrote: > > I am using nHibernate and trying to implement some paging. If I run this > code > >IList list = session.CreateQuery("FROM Author").List(); > > it returns 8 records. If I run this code though > >IList list = session.CreateQuery("FROM Author") >.SetFirstResult(1).SetMaxResults(5).List(); > > it returns 0 records. When I look at the SQL generated I can't see > that there is any paging logic. > > What is the most likely errors with this? > > > Craig > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Sql Server Execution Plans / Parameter Size
BTW, thanks to Claudio Maccari we have write it down http://nhforge.org/wikis/howtonh/tuning-queries-with-ms-sqlserver.aspx On Mon, Mar 16, 2009 at 12:52 AM, Fabio Maulo wrote: > 2009/3/15 Dario Quintana > >> Here it says, that there is no reason to call it in the client application >> where using sql2000 or 2005 >> >> http://msdn.microsoft.com/en-us/library/system.data.idbcommand.prepare.aspx > > > without that parameter the drive (in nh) don't set parameter size. > -- > Fabio Maulo > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: How to use registerfunction to add "NewID()" to the 2005 dialect
Map the NewID() function to a property into your object, then order-by for that property. On Mon, Mar 16, 2009 at 12:39 PM, rsadams wrote: > > Hi All, > > I'm currently trying to add a "more like this" function to my website, > this requires that I pull records ordered by NewID.. If I was using > SQL I'd do this.. > > SELECT TOP 5 * > FROM video > ORDER BY NEWID() > > But it seems that NewID is not a part of the MSSql2005 dialect? So to > add it I' have the following dialect extension (I'm using the Castle > stack by the way) > > public class MSSql2005Extension : MsSql2005Dialect > { >public MSSql2005Extension() >{ > RegisterFunction("newid", new NoArgSQLFunction("NEWID", > NHibernateUtil.Int32)); > // RegisterFunction("newid", new StandardSQLFunction("NEWID()", > NHibernateUtil.Int32)); >} > } > > And I'm registering like so.. > > > > Sadly when I call this.. > > DetachedCriteria criteria = DetachedCriteria.For() > .AddOrder(Order.Desc("NewId()")) > .SetMaxResults(maxResults); > > I get.. > > could not resolve property: NewId() of: NooStar.Core.Video > > Can any one point me in the direction of what I'm doing wrong? Any > help would be a huge help. > > Thanks in advance, > > Richard Adams > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Sql Server Execution Plans / Parameter Size
Here it says, that there is no reason to call it in the client application where using sql2000 or 2005 http://msdn.microsoft.com/en-us/library/system.data.idbcommand.prepare.aspx On Sun, Mar 15, 2009 at 7:14 PM, Fabio Maulo wrote: > > P.S. I don't remember why the "prepare_sql" property is set to "false" in > MsSQL dialect. > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Poor query plans solved with SQL 2008
+1 On Sun, Mar 15, 2009 at 6:48 PM, Fabio Maulo wrote: > ...I'm something tired... > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Validator notNullNotEmpty/notEmpty/notNull localization problems
Thanks On Thu, Mar 12, 2009 at 9:25 PM, JoseFR wrote: > > There are several problems with localizations over all languages with > notNullNotEmpty/notEmpty/notNull. I think that these are the correct > values: > > DE: > >kann nicht leer sein > > >kann nicht leer null > > >kann nicht null oder leer sein > > > ES: > >no debe ser vacío > > >debe ser no nulo > > >no debe ser nulo o vacío > > > FR: > >ne peut pas être vide > > >ne peut pas être nul > > >ne peut pas être nul ou vide > > > IT: > >non può essere vuoto > > >non può essere nullo > > >non può essere nullo o vuoto > > > LV: > >nedrīkst būt tukšs > > >nedrīkst null > > >nedrīkst būt nulle vai tukšs > > > NL: > >mogen niet leeg zijn > > >kan niet worden nietig > > >kan niet worden nietig of lege > > > Correct me if Im wrong. Currently some languages hasn't > validator.notNullNotEmpty and the value for that message is in the > notEmpty. Others languages just has "Indicate value" for the three > messages. > > Please let me know if you want the updated files. > > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Unknown connection option...
There is not such "server" word in those connection strings. Try with "Data Source" or "Server" On Thu, Mar 12, 2009 at 1:14 PM, steves wrote: > > I am sorry for a beginner question, but I cannot go trough this. > > I have SQL EXPRESS server installed, using .NET 3.5. I have > downloaded examples via svn at address "http:// > hibernatingrhinos.googlecode.com/svn/trunk" and tried "FirstSolution" > example. > > It works well, but it uses local db file. When I tried to change > connection string for to connect to SQL server, > I got error "Unknown connection option in connection string: server." > If I change connection string somehow, I get similar errors. > > My hibernate.cfg.xml file: > > > > > name="connection.provider">NHibernate.Connection.DriverConnectionProvider property> >NHibernate.Dialect.MsSql2005Dialect property> > name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver property> >Server=.\SQLEXPRESS; > Initial Catalog=NHExample; Integrated Security=SSPI >true > > > > Various connection strings I tried: > "Server=(local)\SQLEXPRESS; Initial Catalog=NHExample; Integrated > Security=SSPI" > "Server=127.0.0.1\SQLEXPRESS; Initial Catalog=NHExample; Integrated > Security=SSPI" > etc. > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: NH Design Question - Ignoring Field Validation when reading from Database
And a little bit faster On Thu, Mar 12, 2009 at 9:43 AM, Humberto Marchezi wrote: > > So would you say that field accessor is better practice than property > accessor ? > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: DetachedCriteria does not implement ICriteria?
Hi This can give you an answer: http://groups.google.com/group/nhusers/browse_thread/thread/de67c8431adb29b2/fa9f5b716e26792e Cheers On Tue, Mar 10, 2009 at 3:13 PM, TigerShark wrote: > > I might be on the wrong list, but I don't like to bother the dev-list. > > As my subject says, DetachedCriteria does not implement ICriteria... > Why is that? They are very similar and it would be nice if they shared > some common interface. > > Anyway, could someone shed some light on the reason why this is not > the case? > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Validator messages
Next week (after exams) I'll have a look to the interpolator and review this topic. On Tue, Mar 3, 2009 at 7:46 AM, Marc Climent wrote: > > Sorry, I meant the possibility of specifying a custom Resource bundle > to override some default messages with localization. > > Finally I am creating my own Interpolator that works like the > DefaultInterpolator but tries to get the messages from the local > resources for some default validators and for my own ones. Then if not > found returns the message from the defaultInterpolator. This is the > most flexible solution I've found. > > Thanks for the responses. > > On 2 mar, 23:56, Dario Quintana wrote: > > Which feature ? > > > > {floor.out.of.range} is the name of a resource string, you can use it. > > > > On Mon, Mar 2, 2009 at 8:49 PM, Marc Climent > wrote: > > > > > Anyway, will this feature be available in the future? Can I do > > > something about it? > > > > -- > > Dario Quintanahttp://darioquintana.com.ar > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Validator messages
Which feature ? {floor.out.of.range} is the name of a resource string, you can use it. On Mon, Mar 2, 2009 at 8:49 PM, Marc Climent wrote: > > Anyway, will this feature be available in the future? Can I do > something about it? > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: [NHValidator] How to get the instance information in a validator?
Hi Create a Bean-Validator (example a [MyPropertyUnique] in the class instead of property), that means that involve the whole entity. Cheers On Tue, Feb 24, 2009 at 6:02 AM, Karron Qiu wrote: > I want to write my own constraint for checking if the property's value is > unique in database. But the IValidator interface only give me the value of > the property. If I inplement IPropertyConstraint interface, I can get the > name of the property, but I still can't get the information of the entity > that will be validated. Because I need to know the type of the entity to > create a criteria. > > Anyone can give me some advice? Thanks. > > -- > Regards, > Karron > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---
[nhusers] Re: Creating a Unit Test for JIRA
Make sure the hbm.xml files are marked as Embedded resource. Send it to us the inner exception, otherwise. On Thu, Feb 19, 2009 at 8:23 PM, JoAnnP38 wrote: > > Based on a suggestion from Fabio Maulo I am creating a unit test that > demonstrates a bug I might have found. First I created my own NUnit > test until I saw on nhforge.org that I should use the NHibernate.Test- > Lite project that is posted. So I transferred my test code to here and > now I get the following error when my mappings are being compiled: > > NHibernate.Test.NHSpecificTest.NH1234.SampleTest (TestFixtureSetUp): > NHibernate.MappingException : Could not compile the mapping document: > NHibernate.Test.NHSpecificTest.NH1234.Mappings.hbm.xml > > System.InvalidOperationException : Could not find the dialect > in the configuration > > What I don't understand is that the SQL dialect is specified in > App.config ("NHibernate.Dialect.MsSql2005Dialect"), so why am I > getting this error? > > > > -- Dario Quintana http://darioquintana.com.ar --~--~-~--~~~---~--~~ 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 options, visit this group at http://groups.google.com/group/nhusers?hl=en -~--~~~~--~~--~--~---