[nhusers] Re: SaveOrUpdate and Delete inconsistency?

2009-07-27 Thread Gustavo Ringel
Since NH 2.0.1 there is no automatic flush, so you should commit a transaction or use flush never and flush by your self.During save or update you are getting because you may be using a strategy like identity which needs a flush to get the ID, but this is more an inevitable problem than a feature.

[nhusers] Re: Force NHibernate to update from database

2009-07-27 Thread Ian Escarro
Thanks. -- Ian On Tue, Jul 21, 2009 at 1:59 PM, Fabio Maulo fabioma...@gmail.com wrote: session.Refreshor the tag generated of a property 2009/7/21 ian ian.esca...@gmail.com I have a trigger to update the quantity of the Item table. Let's say ItemReceipt will trigger plus (+) in item

[nhusers] Re: Setting Primary Key Name

2009-07-27 Thread Nexus
id name=Id column=Id unsaved-value=0 generator class=native/ /id Is is not the column=Id ? Kind regards On 26 jul, 21:52, James Gregory jagregory@gmail.com wrote: AFAIK you can't set the primary key name. Foreign keys yes, primary no. On Sun, Jul 26, 2009 at 8:49 PM, Jan

[nhusers]

2009-07-27 Thread mehmet ali
--~--~-~--~~~---~--~~ 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

[nhusers] Mixed Support

2009-07-27 Thread Nexus
Hi 1) When we use native generator, in code it will first check if the dialect can provide identity values and then sequences, and as a failback it uses table-hilo. I think most people prefer the use of sequences over identities if the database supports it. 2) Could we provide a nativehilo

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
I also bumped into this problem (non-case-sensitive String.Contains() is a really common requirement), and still looking for a solution for this.. which apparently still produces the same exception in the recent release of NH-Linq. Any idea? Thanks On Tue, May 5, 2009 at 1:24 PM, Bryan Murphy

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Tuna Toksoz
var query = from e in db.Employees where e.FirstName.Contains(a) select e; this works, regarding to string.contains. Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Tuna Toksoz
can you retry your query like this: string emailAddress=his.EmailAddress.ToLower(); from u in session.LinqUser() where u.EmailAddress.ToLower() == emailAddress select u; Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com

[nhusers] Problem in Customer-Address mapping

2009-07-27 Thread Jose Samonte
Good day! I've just started to use NHibernate in my applications, but I'm a little bit having a problem trying to create the mapping files for my Customer-Address relationship. I only need to have one Address for one Customer in my object model, and in my database, I would be having a Customers

[nhusers] Problem in mapping

2009-07-27 Thread dyowee
Good day sir! I've just started to use NHibernate in my applications, but I'm a little bit having a problem trying to create the mapping files for my Customer-Address association. I only need to have one Address for one Customer in my object model, but in my database, I would be having a

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
I thought that would generate title LIKE'%a%'? (instead of LOWER(title) LIKE '%a%') On Mon, Jul 27, 2009 at 5:33 PM, Tuna Toksoz tehl...@gmail.com wrote: var query = from e in db.Employees where e.FirstName.Contains(a) select e; this works,

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
Sorry, no joy.. Still exact same exception.. Cheers On Mon, Jul 27, 2009 at 5:35 PM, Tuna Toksoz tehl...@gmail.com wrote: can you retry your query like this: string emailAddress=his.EmailAddress.ToLower(); from u in session.LinqUser() where u.EmailAddress.ToLower() == emailAddress select

[nhusers] Re: Linq Query ToLower

2009-07-27 Thread Hendry Luk
Quite weirdly, this doesnt work too: u.EmailAddress.Equals(emailAddress, StringComparison.CurrentCultureIgnoreCase)) .. even though StringComparison.CurrentCultureIgnoreCase works perfectly with both StartsWith() and EndsWith() . And unfortunately, String.Contains() doesn't have overload that

[nhusers] Re: FutureT is not playing nice with web-services

2009-07-27 Thread Erich Eichinger
However, since there is no valid reason to make DelayedEnumerator public, i would opt to return arrays instead of ienumerable instances in your datacontracts, and just do a .ToArray() when you're assembling your CatalogsForSite object. Your DataContracts shouldn't mention anything

[nhusers] NHibernate connection string: how to specify port number and server\instance?

2009-07-27 Thread Jeffrey
Details are in here: http://stackoverflow.com/questions/1186623/nhibernate-connection-string-how-to-specify-port-number-and-server-instance Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] Re: Entity Updation

2009-07-27 Thread Sachin
Thanks Nexus!! I know it can be handeled in code as I can create two entities where I can fetch values and can create a common entity out of it, but it require me to define multiple entities and also I have to define relations etc. What I was wondering was if I have some thing like SQL where

[nhusers] Re: Entity Updation

2009-07-27 Thread Nexus
You could use projections, or maybe map the two entities by a discriminator greetings On 27 jul, 11:50, Sachin sachingupta1...@gmail.com wrote: Thanks Nexus!! I know it can be handeled in code as I can create two entities where I can  fetch values and can create a common entity out of it,  

[nhusers] How do this query ....

2009-07-27 Thread Kris-I
Hello, I have a table CustomerTypeOfWork : - Id - CustomerId (FK) - TypeOfWorkId (FK) - HourByWeek A table Scheduled : - Id - CustomerTypeOfWork (FK) - HourByWeek I'd like for one customer, get for each TypeOfWork he asked the total of HourByWeek scheduled. A customerTypeOfwork can be

[nhusers] Recursive constraints won't output a proper schema?

2009-07-27 Thread mikoro
Hi, I've been having some problems getting the right schema generated. Here's an example class (stripped versions): public class User { public virtual Guid Id { get; private set; } public virtual Names Names {

[nhusers] Re: Setting Primary Key Name

2009-07-27 Thread Jan Limpens
2009/7/27 Nexus tommar...@gmail.com id name=Id column=Id unsaved-value=0 generator class=native/ /id Is is not the column=Id ? No, not the column name, the name of the Primary Key (PK_Something) On 26 jul, 21:52, James Gregory jagregory@gmail.com wrote: AFAIK you can't

[nhusers] Re: NHibernate connection string: how to specify port number and server\instance?

2009-07-27 Thread Tuna Toksoz
Are you sure that this one works with ADO.NET SQL COnnection? If yes, will work with NH too Tuna Toksöz Eternal sunshine of the open source mind. http://devlicio.us/blogs/tuna_toksoz http://tunatoksoz.com http://twitter.com/tehlike On Mon, Jul 27, 2009 at 3:57 PM, Jeffrey mr.kaw...@gmail.com

[nhusers] Escaping Like

2009-07-27 Thread Dmitiry Nagirnyak
Hi, I have seen that a lot of people are escaping Expression.Like. Isn't there a generic way of doing LIKE avoiding the escaping? Why? Because of set of characters to that should be vary from Db to DB and thus we have to look into Factory/Config to make sure we escape correctly. Is there

[nhusers] Re: Recursive constraints won't output a proper schema?

2009-07-27 Thread James Gregory
Have you tried specifying the columns explicitly? Then applying the length attribute to those. On Mon, Jul 27, 2009 at 3:44 PM, mikoro miko...@gmail.com wrote: Hi, I've been having some problems getting the right schema generated. Here's an example class (stripped versions): public

[nhusers] Is that an insect?

2009-07-27 Thread Nelson
Hello open people, I think I founded a bug in NHibernate 2.1. Before reading that message and throwing me stones, please know that I founded it at work and I'm pretty tired and lazy now. So if I am not giving enough details, please don't kill me! I prefered posting something before forgetting

[nhusers] count error

2009-07-27 Thread Fernando Zago
Can someone help me with it ? i have an class (City) that uses a System.Guid (GUID.COMB) identifyer. and when i'm trying to count that rows, that exception was thrown Server: Msg 409, Level 16, State 2, Line 4 The count aggregate operation cannot take a uniqueidentifier data type as an argument.

[nhusers] Re: Recursive constraints won't output a proper schema?

2009-07-27 Thread mikoro
Do you mean within the normal NHibernate mapping file? Yes it works. And I can give the constraints with the validator to simple properties of a class. But if I have a subclass, and if I map it with the validator, constraints won't be added to the schema. I have mapped the subclass as a component

[nhusers] generic IUserCollectionType

2009-07-27 Thread darren
I see there is a test case for IUserCollectionType in the source. I've been looking for an example of creating a generic custom collection using that interface but haven't had much luck. I need to create set type that supports INotifyCollectionChanged.

[nhusers] Re: generic IUserCollectionType

2009-07-27 Thread darren
I should have added that is needs to support lazy loading. On Jul 27, 3:49 pm, darren sarcas...@gmail.com wrote: I see there is a test case for IUserCollectionType in the source. I've been looking for an example of creating a generic custom collection using that interface but haven't had much

[nhusers] NHibernate.ADOException : could not delete collection: MySql.Data.MySqlClient.MySqlException : Column set to default value; NULL supplied to NOT NULL column 'POId' at row 1

2009-07-27 Thread Ian Escarro
I have an error in deleting a master/detail relationship. I have a PurchaseOrder class and a PurchaseOrderItem class. These are the mapping. ?xml version=1.0 encoding=utf-8 ? hibernate-mapping xmlns=urn:nhibernate-mapping-2.2 namespace=Bogetz.Elephant.Model assembly=elephant class

[nhusers] Re: SaveOrUpdate and Delete inconsistency?

2009-07-27 Thread Dmitiry Nagirnyak
Hi Gustavo, Ok. Thanks. I'll wrap things in a transaction. Cheers. 2009/7/27 Gustavo Ringel gustavo.rin...@gmail.com Since NH 2.0.1 there is no automatic flush, so you should commit a transaction or use flush never and flush by your self. During save or update you are getting because you may