[nhusers] Many To Many Relationship with Composite Keys

2009-06-07 Thread Ricardo Peres
information on this on the Internet, and the documentation is outdated. Thanks, Ricardo Peres --~--~-~--~~~---~--~~ 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

[nhusers] Re: Many To Many with Composite Keys

2009-06-10 Thread Ricardo Peres
/ /class /hibernate-mapping As you can see, A is the main class, and E holds a reference to an A object, which is also the primary key. Where does the foreign generator fits in? Thanks, Ricardo Peres On Jun 8, 1:27 pm, Fabio Maulo fabioma...@gmail.com wrote: generator=foreing 2009/6/8 Ricardo

[nhusers] Querying a Collection with Criteria API and LINQ to NHibernate

2009-08-01 Thread Ricardo Peres
= session.CreateCriteriaSomeClass(p).Add (NHibernate.Criterion.Expression.Gt(p.Children.Count, 0)).ListSomeClass(); var l3 = (from l in session.LinqSomeClass() where l.Children.Count 0 select l).ToList(); var l4 = session.LinqSomeClass().Where(l = l.Children.Count 0).ToList(); Can you help? Thanks, Ricardo Peres

[nhusers] Re: Querying a Collection with Criteria API and LINQ to NHibernate

2009-08-02 Thread Ricardo Peres
, Ricardo Peres rjpe...@gmail.com wrote: Hello, I have this simple class: public class SomeClass {    public Int32 Id { get; set; }    public SomeClass Parent { get; set; }    public ISetSomeClass Children { get; set; } } As you can see, it maps a simple table which is related

[nhusers] Querying Collection Count With LINQ to NHibernate

2009-08-12 Thread Ricardo Peres
perfectly. I basically have an Id, a Parent and a Children properties, I am mapping a parent-child relationship. The exception I get is: QueryException: could not resolve property: Children.Id of:SomeClass Any ideas? Where can I get more support for LINQ to NHibernate? Thanks, Ricardo Peres

[nhusers] Re: Querying Collection Count With LINQ to NHibernate

2009-08-13 Thread Ricardo Peres
, Aug 12, 2009 at 12:57 PM, Ricardo Peres rjpe...@gmail.com wrote: Hi, I have made this answer days ago, but no one answered... Here I go again. I can't run this query: var lll = (from l in session.LinqSomeClass()                                                   where l.Children.Count

[nhusers] Re: Burrow compiled against NHibernate 2.1.0

2009-08-24 Thread Ricardo Peres
Read this post and see if it applies: http://weblogs.asp.net/ricardoperes/archive/2009/08/20/using-nhibernate-validator-1-0-with-nhibernate-2-1.aspx On Aug 11, 5:54 pm, Tomasz Modelski (IDev) modelski.tom...@gmail.com wrote: Hi. Where can I find Burrow compiled with latest NHibernate 2.1.0

[nhusers] Query Object Pattern

2009-09-06 Thread Ricardo Peres
) that goes all the way to the presentation layer, which is the better option for doing so, so that it is possible to enhance the original query? Thanks, Ricardo Peres --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers

[nhusers] Re: Query Object Pattern

2009-09-07 Thread Ricardo Peres
Are there any good examples of query classes, other than specification (which are already implemented, for example, in NCommon)? There are two different scenarios, I believe: - If there is need to cross application domains (e.g., web services or remoting) - If not What would such a class look

[nhusers] Auditable Columns

2009-09-07 Thread Ricardo Peres
in all .hbm.xml files the corresponding mapping, or can I use something like an abstract base class (or interface, in this case) mapping? Thanks, Ricardo Peres --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers

[nhusers] Data Access Restrictions

2009-09-07 Thread Ricardo Peres
Hello, What would be the best way to implement restriction of data for a given user? For example, let's say I have a table which connects users with some products; what I want is, when I fetch products, I want to see only those that I have access to. Any ideas? Thanks, RP

[nhusers] Re: Data Access Restrictions

2009-09-07 Thread Ricardo Peres
://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike On Mon, Sep 7, 2009 at 2:06 PM, Ricardo Peres rjpe...@gmail.com wrote: Hello, What would be the best way to implement restriction of data for a given user? For example, let's say I have a table which connects

[nhusers] Re: Data Access Restrictions

2009-09-07 Thread Ricardo Peres
/tehlike On Mon, Sep 7, 2009 at 2:15 PM, Ricardo Peres rjpe...@gmail.com wrote: If necessary, I can use filters, but I was looking for something on the NHibernate pipeline that would let me inject custom criterias... Does this exist? On Sep 7, 7:12 pm, Tuna Toksoz tehl...@gmail.com wrote

[nhusers] Re: Auditable Columns

2009-09-07 Thread Ricardo Peres
On Sep 7, 7:05 pm, Ricardo Peres rjpe...@gmail.com wrote: Hello again, Suppose I have an interface like this: public interface IAuditable {     String CreatedBy { get; set; }     DateTime CreatedAt { get; set; }     String UpdatedBy { get; set; }     DateTime UpdatedAt { get; set

[nhusers] Hierarchical Queries

2009-09-07 Thread Ricardo Peres
Hi, I have asked this before, but got no answer, so here I go again: what is the best way to perform hierarchical queries, such as Oracle's CONNECT BY PRIOR and SQL Server's WITH? I thought about having SQL queries (sql-query elements) and then using a AliasToBean transformer, the problem is

[nhusers] Re: Auditable Columns

2009-09-07 Thread Ricardo Peres
But... what about multiple interfaces? On Sep 7, 7:32 pm, Ricardo Peres rjpe...@gmail.com wrote: Forget it: class name=IAuditable abstract=true   property name=CreatedBy column=`CREATED_BY`/   property name=CreatedAt column=`CREATED_AT`/   property name=UpdatedBy column=`UPDATED_BY

[nhusers] Re: Data Access Restrictions

2009-09-08 Thread Ricardo Peres
, and then the repository methods were written to take this into account. /Oskar 2009/9/7 Ricardo Peres rjpe...@gmail.com: Hmm, never used Rhino * products, so can't tell, but possibly yes. On Sep 7, 7:16 pm, Tuna Toksoz tehl...@gmail.com wrote: rhino security kind fo thing

[nhusers] Cancel Default Processing in Event Listener

2009-09-08 Thread Ricardo Peres
Hi, Is it possible to cancel the default processing in an event listener? For example, in an IPreLoadEventListener or ILoadEventListener is it possible to cancel loading of an entity? Thanks, RP --~--~-~--~~~---~--~~ You received this message because you are

[nhusers] Re: Loading a tree efficiently

2009-09-15 Thread Ricardo Peres
That's because the ChildResources is lazy loaded. Add lazy=false to the mapping. On Sep 14, 4:45 pm, trull...@googlemail.com trull...@googlemail.com wrote: I have a tree where every node is a Resource class: public abstract class Resource {         public virtual Guid Id { get; set; }      

[nhusers] Compile LINQ Queries

2009-09-17 Thread Ricardo Peres
Hello, Is it possible to compile a LINQ query, like it is for LINQ to SQL or Entity Framework? Thanks, RP --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers group. To post to this group, send email to

[nhusers] Query-only Property With Where Clause

2009-10-04 Thread Ricardo Peres
is trying to persist my entities, I have explicitly marked the query-only property as mutable=false and optimistic-lock=false. Any clues? Thanks, Ricardo Peres --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups nhusers group

[nhusers] Re: Query-only Property With Where Clause

2009-10-05 Thread Ricardo Peres
Well, I tried it after you mentioned it, but I believe it is not even closely related to my problem, since I'm not deleting anything. On Oct 5, 2:36 pm, webpaul goo...@webpaul.net wrote: Have you tried cascade=none? On Oct 4, 3:27 am, Ricardo Peres rjpe...@gmail.com wrote: Hello, I

[nhusers] Re: Query-only Property With Where Clause

2009-10-05 Thread Ricardo Peres
/ /id set name=RecentO mutable=false optimistic-lock=false access=none where=(Date = (GetDate() - 30)) key column=`MID` not-null=true/ one-to-many class=O/ /set /class /hibernate-mapping Thanks, anyway! RP On Oct 5, 9:58 pm, Ricardo Peres rjpe...@gmail.com wrote: Well, I

[nhusers] Re: nhibernate deletes all my record before inserting

2009-10-06 Thread Ricardo Peres
You can't use an ISet if you are using an idbag, AFAIK. On Oct 6, 8:50 am, graphicsxp graphic...@googlemail.com wrote: Thanks guys you pointed to the problem. I've used an ISet instead and it's working much better now. Oskar, would there be a benefit over ISet if I used an idbag ?* Thanks

[nhusers] Re: Is it possible to find dirty property

2009-10-09 Thread Ricardo Peres
Harm, See if this is what you need: http://weblogs.asp.net/ricardoperes/archive/2009/10/09/finding-dirty-properties-in-nhibernate.aspx On Oct 9, 10:27 am, Harm Neervens h.neerv...@gmail.com wrote: It should be: string className = NHibernateProxyHelper.GuessClass(entity).FullName;  3) Do

[nhusers] Manually Indexing an Entity with NHibernate Search

2009-10-12 Thread Ricardo Peres
Hi, I'm trying to manually index an entity, that is, not on the PostInsert, PostDelete and PostUpdate events. I have this code, which isn't doing anything: SearchFactoryImpl searchFactory = SearchFactoryImpl.GetSearchFactory (cfg); Work work = new Work(entity, entity.Id, WorkType.Add); //also

[nhusers] Re: Manually Indexing an Entity with NHibernate Search

2009-10-14 Thread Ricardo Peres
Even better: using (IFullTextSession searchSession = Search.CreateFullTextSession (session)) { searchSession.Index(entity); } Thanks, Ayende! On Oct 13, 2:36 pm, Ricardo Peres rjpe...@gmail.com wrote: Found it: I had forgot the tx.Commit()! On Oct 12, 11:51 am, Ricardo Peres rjpe

[nhusers] Re: Testers wanted - Visual NHibernate beta

2009-12-02 Thread Ricardo Peres
Hi, Gareth! First of all, nice work! NHibernate is indeed in need of some supporting tools; NHProf and Visual NHibernate are good examples of such tools! Some comments, however: - Why aren't all properties virtual by default, or, at least, those properties that represent relations to other

[nhusers] Re: Testers wanted - Visual NHibernate beta

2009-12-03 Thread Ricardo Peres
. On 2 Dec, 12:39, Ricardo Peres rjpe...@gmail.com wrote: Hi, Gareth! First of all, nice work! NHibernate is indeed in need of some supporting tools; NHProf and Visual NHibernate are good examples of such tools! Some comments, however: - Why aren't all properties virtual by default

[nhusers] New Linq Provider

2009-12-18 Thread Ricardo Peres
Hi, Where can I find the new Linq provider (Steve Strong's)? I was told it was in the trunk, but I can't find anything in it that looks like it, namely, the Query extension method for ISession. Thanks, RP -- You received this message because you are subscribed to the Google Groups nhusers

[nhusers] Re: New Linq Provider

2009-12-18 Thread Ricardo Peres
/trunk/nhibern...And for usage you should look Steve Strong Linq Test found here:http://nhibernate.svn.sourceforge.net/viewvc/nhibernate/trunk/nhibern... This as I know NHibernate 3 Alpha 1 version. Hope it helps! Kornelije Sajler On Fri, Dec 18, 2009 at 11:40, Ricardo Peres rjpe

[nhusers] ASP.NET Dynamic Data

2009-12-18 Thread Ricardo Peres
Hello, Has anyone succeeded (or even tried) using the new NHibernate Linq provider with ASP.NET Dynamic Data? Is anyone interested on this? I know that the NHContrib one does not work. Thanks, RP -- You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] ASP.NET Dynamic Data NHibernate Provider

2010-01-03 Thread Ricardo Peres
-nhibernate-provider.aspx, and don't forget to send me your feedback. Thanks, Ricardo Peres -- 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

[nhusers] SQL Server 2008 Encryption

2010-02-10 Thread Ricardo Peres
Hello, Has anyone successfully used SQL Server 2008 encryption with NHibernate? The get part for properties is simple, one must provide a formula, but the set part is trickier. Probably it can only be achieved through custom user types. Any ideas? Thanks, Ricardo Peres -- You received

[nhusers] Compilation of Queries

2010-02-17 Thread Ricardo Peres
Hello, Does NHibernate support compilation of queries (HQL, Criteria, LINQ)? I was looking for ways to speed up the generation of the actual SQL, I assume it has to be done each time a query is List()ed, or is there a query cache for HQL, Criteria and LINQ? Thanks! Ricardo Peres -- You

[nhusers] Re: Compilation of Queries

2010-02-17 Thread Ricardo Peres
, RP On Feb 17, 1:15 pm, Gustavo Ringel gustavo.rin...@gmail.com wrote: HQL named queries are compiled at the beggining. Gustavo. On Wed, Feb 17, 2010 at 2:50 PM, Ricardo Peres rjpe...@gmail.com wrote: Hello, Does NHibernate support compilation of queries (HQL, Criteria, LINQ)? I

[nhusers] Re: Circular Reference mapping

2010-02-24 Thread Ricardo Peres
Hi, Fabio! Does this mean that you are advocating entities to have knowledge of ISession, in the GetLastestVersion method? If not, how would we implement this? I am not complaining, just wanted to know your opinion! :-) Thanks, RP On Feb 24, 3:08 am, Fabio Maulo fabioma...@gmail.com wrote:

[nhusers] Re: Circular Reference mapping

2010-02-24 Thread Ricardo Peres
Never met him, just curiosity! Thanks! RP On Feb 24, 1:19 pm, Fabio Maulo fabioma...@gmail.com wrote: What ? GetLastestVersion does not need to know about session, it only need to find the lastestXYZ inside the collection AllVersion. Are you working with Chris B ? 2010/2/24 Ricardo Peres

[nhusers] Table Per Concrete Type and Id Generator

2010-03-03 Thread Ricardo Peres
for dealing with this? HiLo? Thanks, Ricardo Peres -- 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

[nhusers] Re: UnitOfWork and HttpContext

2010-03-03 Thread Ricardo Peres
Zorgoban, If you are using async pages or async controls, the request is handled by a different thread. RP On Mar 3, 7:42 am, Zorgoban r...@yahoo.com wrote: I dont like how this Hanselmann states his personal opinion as fact without really explaining the backgrounds. He absolutely lost my

[nhusers] Re: [OT] Where Are You From?

2010-03-04 Thread Ricardo Peres
Coimbra, Portugal. On Mar 3, 7:36 pm, Jose A. Salvador Vanaclocha joans...@gmail.com wrote: Valencia, Spain William John Adam Trindade escribi : Trois-Rivi res,Qu bec, Canada but, I'm Brazilian! 2010/3/3 Harold Wanyama wanyal...@gmail.com mailto:wanyal...@gmail.com     Iam from

[nhusers] Re: LinqToNhibernate, JOIN, Expand

2010-03-23 Thread Ricardo Peres
hawkwood, That happens because of JOINs between two tables, where the right table has more that one record for the item on the left table. Have you tried distinct? var ldossier = (from dos in session.LinqDossier().Expand(ListeLogicielDossier) where dos.CodeDossier == 0114

[nhusers] Re: Faster Startup and better performance

2010-03-30 Thread Ricardo Peres
Visar, In order to fasten startup time, you can serialize the Configuration object: Configuration cfg = new Configuration().Configure(); IFormatter serializer = new BinaryFormatter(); using (Stream stream = File.OpenWrite(Configuration.serialized)) { serializer.Serialize(stream,

[nhusers] NHibernate Portugal Mailing List

2010-04-26 Thread Ricardo Peres
Greetings, For the portuguese-speaking members of this list, I just created a new mailing list, NHibernate Portugal, for the discussion of NHibernate issues in portuguese: http://groups.google.com/group/nhpt. Drop by (or, apareçam!). Regards, RP -- You received this message because you are

[nhusers] Re: NH and Fluent best pratice using database enumeration

2010-08-03 Thread Ricardo Peres
Or better: public class Something { protected virtual int myIntValue { get; set; } public MyEnumeration MyEnumeratedValue { get { return((MyEnumeration) this.myIntValue); } set { this.myIntValue = value; } } } On Aug 3, 8:14 am, Frans Bouma

[nhusers] Re: Detecting dirty Object/property in new session

2010-09-03 Thread Ricardo Peres
Amir, The short answer is: you can't. If the entity is not attached to a session, there's no way to know its original values, because NHibernate entities are not self-tracking (Entity Framework 4, among others, does support this). What you could do is load an entity by id in another session and

[nhusers] Re: NHibernate 3.0 Cookbook

2010-09-07 Thread Ricardo Peres
Hello, Jason! Could you please publish the table of contents? Thanks! RP On Sep 6, 7:51 pm, Jason Dentler jasondent...@gmail.com wrote: Hi Sal, For the book, we are targeting October 8th, but that is no absolute   guarantee. As for NH3, the most recent estimate I've heard is still around

[nhusers] Re: persister.SetPropertyValue in IPreUpdateEventListener doesn't propagate changes into DB on inherited classes

2011-02-21 Thread Ricardo Peres
Filip, This works: public class SaveListener: DefaultSaveEventListener { protected override Object PerformSaveOrUpdate(SaveOrUpdateEvent @event) { if (@event.Entity is Post) { Post post = (@event.Entity as Post);

[nhusers] Regarding Hibernate and NHibernate

2011-03-29 Thread Ricardo Peres
Hello, I have this question for the NHibernate development team, specially Fabio. This is something I never saw explained, and I often think of it, if you have some link at hand, I'd be happy to see it. How do the Hibernate and NHibernate products relate? That is, apart from the .NET-specific

[nhusers] Re: mapping via join / and where clause (bug in NHibernate?)

2011-03-29 Thread Ricardo Peres
Fabio, Is there a JIRA for subselect/? If not, where can we see more information? Thanks, RP On Mar 27, 5:42 pm, Fabio Maulo fabioma...@gmail.com wrote: a view On Sat, Mar 26, 2011 at 8:30 PM, Krzysztof Kozmic krzysztof.koz...@gmail.com wrote: Hey all, @Fabio - the

[nhusers] Re: Regarding Hibernate and NHibernate

2011-03-29 Thread Ricardo Peres
wrote: We have talked about these stuff many times in our dev-list. I can't find all threads right now. In-lines some short answers: On Tue, Mar 29, 2011 at 11:25 AM, Ricardo Peres rjpe...@gmail.com wrote: Hello, I have this question for the NHibernate development team, specially Fabio

[nhusers] Re: save object validation with callback

2011-04-04 Thread Ricardo Peres
Have you tried creating a new session from inside the listener? using (ISession childSession = evt.Session.GetSession(EntityMode.Poco)) { ... } On Apr 4, 4:15 pm, David Laabs david.la...@createctrl.com wrote: I looked around a little bit in this forum and in the web... This seems to be a

[nhusers] Mapping By Code and Subselect

2011-04-05 Thread Ricardo Peres
Hello, Does the new mapping by code work with the also new subselect/ feature? I'm asking this because I can't get it to work, although it doesn't throw any exception. Also, I can't find a way to specify the synchronize/ element. It does work well with XML configuration, though. Here's my code:

[nhusers] Calling Base Implementation in New Dynamic Proxy Interceptor

2011-04-05 Thread Ricardo Peres
Hi, With Castle's Dynamic Proxy interceptor (Castle.DynamicProxy.IInterceptor), we would call the base implementation inside the Intercept method by calling invocation.Proceed(). Is there a way to do the same using the new NHibernate.Proxy.DynamicProxy.IInterceptor? From what I can see, we must

[nhusers] Re: Calling Base Implementation in New Dynamic Proxy Interceptor

2011-04-05 Thread Ricardo Peres
On Tue, Apr 5, 2011 at 2:39 PM, Ricardo Peres rjpe...@gmail.com wrote: Hi, With Castle's Dynamic Proxy interceptor (Castle.DynamicProxy.IInterceptor), we would call the base implementation inside the Intercept method by calling invocation.Proceed(). Is there a way to do the same

[nhusers] Re: Calling Base Implementation in New Dynamic Proxy Interceptor

2011-04-05 Thread Ricardo Peres
Got it: returnValue = info.TargetMethod.Invoke(this, info.Arguments); On Apr 5, 8:28 pm, Ricardo Peres rjpe...@gmail.com wrote: Yes, Fabio, I understand. Here's the situation: like I said, I know how to do it with Castle Dynamic Proxy. I was thinking that if I can do this with NHibernate's

[nhusers] Re: Calling Base Implementation in New Dynamic Proxy Interceptor

2011-04-06 Thread Ricardo Peres
, Ricardo Peres rjpe...@gmail.com wrote: Got it: returnValue = info.TargetMethod.Invoke(this, info.Arguments); On Apr 5, 8:28 pm, Ricardo Peres rjpe...@gmail.com wrote: Yes, Fabio, I understand. Here's the situation: like I said, I know how to do it with Castle Dynamic Proxy. I

[nhusers] Custom Id Generator With Mapping By Code

2011-04-07 Thread Ricardo Peres
Hello, Is it already possible to use a custom generator (derived from TableHiLoGenerator)? If so, how can I do it? Here's the code I have: ModelMapper mapper = new ModelMapper(); mapper.ClassCustomer(ca = { ca.Table(`CUSTOMER`); ca.Lazy(false); ca.Id(x = x.Id, map =

[nhusers] Re: Custom Id Generator With Mapping By Code

2011-04-07 Thread Ricardo Peres
{ return (typeof(Int64)); } } Boolean IGeneratorDef.SupportedAsCollectionElementId { get { return (true); } } #endregion } On Apr 7, 11:07 am, Ricardo Peres rjpe

[nhusers] Collection Property Is Null

2011-04-07 Thread Ricardo Peres
Hello, again! When retrieving an entity, a collection property is always null, even when I try to force eager loading: using (ISession session = factory.OpenSession()) { Customer c1 = session.GetCustomer(2002L); Customer c2 = session.CreateQuery(from Customer c join fetch

[nhusers] Re: Collection Property Is Null

2011-04-07 Thread Ricardo Peres
it without using NH. Am schrieb Ricardo Peres rjpe...@gmail.com: Hello, again! When retrieving an entity, a collection property is always null, even when I try to force eager loading: using (ISession session = factory.OpenSession()) { Customer c1 = session.Get(2002L); Customer c2

[nhusers] Re: Collection Property Is Null

2011-04-08 Thread Ricardo Peres
trunk version (as of 12:00 of today). Can anyone confirm this is an issue? If so, I will create a JIRA issue. Thanks, RP On Apr 8, 5:43 am, Ricardo Peres rjpe...@gmail.com wrote: Why is that? I'm loading it from the DB, NHibernate should create it itself. In fact, it does, if I don't use lazy

[nhusers] Re: NHibernate 3.2.0 Alpha1

2011-04-12 Thread Ricardo Peres
The problem is that they cannot be used: old providers implement interface NHibernate.Bytecode.IProxyFactoryFactory, while the new code references NHibernate.ByteCode.IProxyFactoryFactory (notice the casing in ByteCode). On Apr 11, 5:26 pm, Fabio Maulo fabioma...@gmail.com wrote: from

[nhusers] Re: NHibernate 3.2.0 Alpha1

2011-04-12 Thread Ricardo Peres
Sorry, my fault. Forget my last message. On Apr 12, 1:56 pm, Raul Carlomagno rcarloma...@gmail.com wrote: an official nh mapper by code, nice what about bytecode provider? is it based on some framework? or written from scratch congrats for the new release -- You received this message

[nhusers] LINQ Provider: Sum When There Are No Elements

2011-04-14 Thread Ricardo Peres
Hello, How can I do a sum using a LINQ query when the query produces no elements? Int32 sum = (from a in session.QueryAnalogicalValue() select a.Value).Sum(); This fails with a NullReferenceException. The DefaultIfEmpty operator could probably solve this, but it is not yet implemented. Does any

[nhusers] Re: LINQ Provider: Sum When There Are No Elements

2011-04-14 Thread Ricardo Peres
Found an old thread about the same problem: http://groups.google.com/group/nhusers/browse_thread/thread/cb2d05d9d3e57b6b/f5a1e0586c17dac7 and a JIRA ticket: http://216.121.112.228/browse/NHLQ-8. On Apr 14, 12:50 pm, Ricardo Peres rjpe...@gmail.com wrote: Hello, How can I do a sum using a LINQ

[nhusers] Re: LINQ Provider: Sum When There Are No Elements

2011-04-14 Thread Ricardo Peres
Hello, Vahid! Yes, I know... the problem is that Value is not a nullable type; what happens is that there are no elements to sum, the same happens when using SQL: SELECT SUM(Value) FROM AnalogicalValue WHERE 1 = 2 returns NULL. I solved my problem with: Object result =

[nhusers] Re: LINQ Provider: Sum When There Are No Elements

2011-04-14 Thread Ricardo Peres
Ooops, forget the text after my signature (RP)! On Apr 14, 4:53 pm, Ricardo Peres rjpe...@gmail.com wrote: Hello, Vahid! Yes, I know... the problem is that Value is not a nullable type; what happens is that there are no elements to sum, the same happens when using SQL: SELECT SUM(Value) FROM

[nhusers] Re: Collection Property Is Null

2011-04-15 Thread Ricardo Peres
project at http://cid-0450c015fc418de2.office.live.com/self.aspx/.Public/NHTest.zip. Can someone confirm there is a bug, please? Thanks, RP On Apr 8, 12:03 pm, Ricardo Peres rjpe...@gmail.com wrote: This is the current status of this issue: - If the entity is mapped as lazy

[nhusers] Re: LINQ Provider: Sum When There Are No Elements

2011-04-15 Thread Ricardo Peres
Vahid, you're THE man! It worked! I didn't know this technique. Thanks! RP On Apr 14, 5:16 pm, Vahid vahid.nas...@gmail.com wrote: In my post Value is not a nullable type. So you saw that casting. -- You received this message because you are subscribed to the Google Groups nhusers group. To

[nhusers] Re: NHibernate SessionFactory Oracle ODP.net Connection Properties

2011-04-15 Thread Ricardo Peres
You can cast the session.Connection to a OracleConnection and set these properties. If you want to do it everytime, subclass OracleDataClientDriver and add code to an overriden CreateConnection method: public class MyOracleDataClientDriver: OracleDataClientDriver { public override

[nhusers] Re: Mapping by code (Revealing protected/private fields properties)

2011-04-15 Thread Ricardo Peres
What about using something like this: public static ExpressionFuncTEntityType, TPropertyType PropertyTEntityType, TPropertyType(String propertyName) { Type entityType = typeof(TEntityType); PropertyInfo pi = entityType.GetProperty(propertyName, BindingFlags.NonPublic |

[nhusers] Re: NHibernate SessionFactory Oracle ODP.net Connection Properties

2011-04-15 Thread Ricardo Peres
().Configure().BuildSessionFactory(); ERROR:::===  Could not create the driver from RR_Web.MyOracleDataClientDriver. Do I need to add anything else?  Is System.Data.IDbConnection correct for CreateConnection? Thanks, Robert On Apr 15, 2:33 pm, Ricardo Peres rjpe...@gmail.com wrote: You

[nhusers] Re: NHibernate SessionFactory Oracle ODP.net Connection Properties

2011-04-15 Thread Ricardo Peres
Or go loquacious: http://codebetter.com/jameskovacs/2011/01/21/loquacious-configuration-in-nhibernate-3/ On Apr 15, 10:52 pm, Ricardo Peres rjpe...@gmail.com wrote: You probably have to use the assembly qualified type name, such as RR_Web.MyOracleDataClientDriver, RR_Web (if RR_Web

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-18 Thread Ricardo Peres
Did you try defining your entity as lazy=true? It must be lazy in order to use lazy properties. However, I do think there's a bug with Castle bytecode provider, and I have submitted a JIRA issue: http://216.121.112.228/browse/NH-2646. RP On Apr 18, 9:45 am, kor korkl...@yahoo.it wrote: i have a

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-18 Thread Ricardo Peres
and only change the signature of one proxy-factory method. On Mon, Apr 18, 2011 at 8:15 AM, Ricardo Peres rjpe...@gmail.com wrote: Did you try defining your entity as lazy=true? It must be lazy in order to use lazy properties. However, I do think there's a bug with Castle bytecode

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-18 Thread Ricardo Peres
we can see it. The embedded provider are passing all NH3.1 tests and more. On Mon, Apr 18, 2011 at 11:34 AM, Ricardo Peres rjpe...@gmail.com wrote: Fabio, The current trunk version has problems with lazy loading as well: not setting id properties with private setter and setting

[nhusers] Re: SubSelect

2011-04-18 Thread Ricardo Peres
You are using the old NHContrib LINQ provider; NHibernate now has it's own provider in the core (QueryT extension method instead of LinqT). I don't know if the old provider supported enums, perhaps someone else can help with that. BTW, is the References line commented out? RP On Apr 18, 1:05 

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-18 Thread Ricardo Peres
at 12:12 PM, Ricardo Peres rjpe...@gmail.com wrote: Yes, I have. I placed a link on all these JIRA issues: http://cid-0450c015fc418de2.office.live.com/self.aspx/.Public/NHTest.zip. Like I said, I only want a second opinion, I may be doing something wrong. RP On Apr 18, 4:00 pm, Fabio

[nhusers] Re: SubSelect

2011-04-18 Thread Ricardo Peres
for the answer. I'm not fixed with LINQ, i can run the Query in plain old HQl as well. But, i have no idea how to write down the query. Peter On 18 Apr., 17:15, Ricardo Peres rjpe...@gmail.com wrote: You are using the old NHContrib LINQ provider; NHibernate now has it's own

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-19 Thread Ricardo Peres
be 'public/protected virtual' or 'protected internal virtual' On Mon, Apr 18, 2011 at 1:45 PM, Ricardo Peres rjpe...@gmail.com wrote: Fabio, You mean I can't have an id property with a private setter? Is that a removable limitation imposed by the new proxy generator? If so, I

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-19 Thread Ricardo Peres
) { p.Lazy(true); } }); Translating, I am trying to define a virtual string property as lazy, inside a lazy class. If I do so, the setter property is not set. If not, everything works fine. RP On Apr 19, 10:42 am, Ricardo Peres rjpe...@gmail.com wrote: Yes, José

[nhusers] Re: NHibernate configuration problem

2011-04-19 Thread Ricardo Peres
Have you tried Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), hibernate.cfg.xml);? On Apr 19, 11:42 am, mynkow myn...@gmail.com wrote: Hi I have strange problem. When I call nhConfigFilePath = hibernate.cfg.xml; configuration.Configure(nhConfigFilePath); I

[nhusers] Re: NHibernate 3.2.0 Alpha2

2011-04-19 Thread Ricardo Peres
' On Mon, Apr 18, 2011 at 1:45 PM, Ricardo Peres rjpe...@gmail.com wrote: Fabio, You mean I can't have an id property with a private setter? Is that a removable limitation imposed by the new proxy generator? If so, I will create a JIRA issue. To me, it is interesting to not let people

[nhusers] Re: Looking for an entity load / get / query hook

2011-04-20 Thread Ricardo Peres
For entity loading, it is easy: public class PostLoadEventListener : IPostLoadEventListener { public void OnPostLoad(PostLoadEvent @event) { ... } } You can register it through code: cfg.EventListeners.PostLoadEventListeners = new IPostLoadEventListener[] { new

[nhusers] Re: How do I filter a join /?

2011-04-26 Thread Ricardo Peres
I believe this behavior (filtering of joins) is not implemented. There is, however, a post at the wiki regarding localization techniques: http://nhforge.org/wikis/howtonh/localization-techniques.aspx On Apr 26, 10:38 am, Shatl v...@alphacloud.net wrote: Hi, How you managed to solve this

[nhusers] Re: HN3.1 LINQ query and filter on one-to-one mapping

2011-04-26 Thread Ricardo Peres
A wiki article on localization techniques with NHibernate: http://nhforge.org/wikis/howtonh/localization-techniques.aspx On Apr 26, 10:29 am, Shatl v...@alphacloud.net wrote: Hi, I'm adding Multilanguage support to my application. User should see localized data based on language selected in

[nhusers] Re: HN3.1 LINQ query and filter on one-to-one mapping

2011-04-26 Thread Ricardo Peres
Is the filter active for the current session? On Apr 26, 2:19 pm, Shatl v...@alphacloud.net wrote: Thanks, I tried Ayendee's approach, but I need to store several localizable properties per entity and using subquery per property seems to be a performance bottleneck. I would like to do Linq

[nhusers] Re: NHibernate doing updates on other obejcts...... why???

2011-04-26 Thread Ricardo Peres
Do your long or int fields map to nullable columns in the database? If so, you must map them as long ? or int ?. On Apr 26, 3:01 pm, Maximilian Raditya m4h...@gmail.com wrote: No problem, Peter. I'd like to see if I could offer any help here. So, let me summarize your situation. Please

[nhusers] Re: problems with value null in datetime

2011-05-04 Thread Ricardo Peres
Have you heard of nullable types? Protected nullableField As Nullable(Of DateTime) On May 4, 8:09 am, foruminar forum.i...@googlemail.com wrote:  Hello there I'm using VB.NET and MySQL. I have a datetime attribute which has either a date or null in the database. In VB.Net the type of the

[nhusers] Re: NHibernate, IUpdatable and WCF Data Services

2011-05-09 Thread Ricardo Peres
@object, You also must take some things in consideration: - Relations must be entities or simple collections of entities (IListT, IEnumerableT), not sets (ISetT, HashSetT) or maps (IDictionary, IDictionaryK, V, HashTable); - The ID property must be called either ID, or end with ID, for example,

[nhusers] Re: Bizarre error when using NHibernate, IPreInsertEventListener, Oracle, batching and sequences

2011-05-09 Thread Ricardo Peres
@Krzysztof: Shouldn't you be calling the base class' implementation? public class MySaveOrUpdateEventListener: DefaultSaveOrUpdateEventListener { public override void OnSaveOrUpdate(SaveOrUpdateEvent @event) { //do something with the entity base.OnSaveOrUpdate(@event);

[nhusers] Re: NHibernate, IUpdatable and WCF Data Services

2011-05-09 Thread Ricardo Peres
or simple collections of entities.But Category is an entity, what else can it be? I also tried changing from ICollection to IList, but still the same error on many side of the relation. Vagif On Mon, May 9, 2011 at 11:23 AM, Ricardo Peres rjpe...@gmail.com wrote: @object, You also

[nhusers] Re: NHibernate, IUpdatable and WCF Data Services

2011-05-09 Thread Ricardo Peres
is not included in standard NH release and only exists on the net in blog posts? Shouldn't this be rather standard extension for NHibernate? Vagif On Mon, May 9, 2011 at 1:15 PM, Ricardo Peres rjpe...@gmail.com wrote: Vagif, The error is related to having a proxy (Castle) instead

[nhusers] Re: Fetching projection of expanded entity in OData

2011-05-09 Thread Ricardo Peres
WCF Data Services supports projections (server-side, not client-side, this you can always do with LINQ to Objects), but you have to enable them: public static void InitializeService(DataServiceConfiguration config) { config.DataServiceBehavior.MaxProtocolVersion =

[nhusers] Re: SqlDateTime Overflow When Deleting Entity

2011-05-16 Thread Ricardo Peres
Most likely because you have a null column in the database mapped to a non-nullable property. NHibernate detects that the current value is different than the loaded value (null) and tries to save the entity. On May 16, 6:02 pm, Julio Henriquez julio.m.henriq...@gmail.com wrote: I'm still stuck

[nhusers] Re: Difference between lazy=proxy|no-proxy

2011-05-20 Thread Ricardo Peres
Is your entity marked as lazy? If not, the only thing that can be lazy loaded (or proxied, if you prefer) is one to many collections. On May 20, 6:36 pm, Mohamed Meligy eng.mel...@gmail.com wrote: I have done some test now. Yeah, it does load the reference if you set lazy=no-proxy although the

[nhusers] Re: Difference between lazy=proxy|no-proxy

2011-05-20 Thread Ricardo Peres
: cid:image005@01CAF81D.6A076510] http://twitter.com/meligy  http://www.greatplacetowork.com.au/best/best-companies-australia.phphttp://www.readify.net/AboutUs/NewsItem.aspx?id=10 On Sat, May 21, 2011 at 4:07 AM, Ricardo Peres rjpe...@gmail.com wrote: Is your entity marked as lazy

[nhusers] Entity Is Not Dirty However Session Is

2011-05-23 Thread Ricardo Peres
Hi, I am having this problem: - I load a User entity from the DB using session.GetT(); - It loads an additional collection UserGroups containing only one entity; - I have an event listener for the SaveOrUpdate event: cfg.EventListeners.SaveOrUpdateEventListeners =

[nhusers] Re: Entity Is Not Dirty However Session Is

2011-05-23 Thread Ricardo Peres
Forgot to tell: I am using HiLo for ids and, of course, I am not changing anything on any of the loaded entities. No second level cache either. On May 23, 12:43 pm, Ricardo Peres rjpe...@gmail.com wrote: Hi, I am having this problem: - I load a User entity from the DB using session.GetT

  1   2   3   4   5   >