[nhusers] Indexed list with attributes

2021-12-24 Thread Michal Cicatka
I have a list of items which includes null and I would like to map it to my DB using the *NHibernate.Mapping.Attributes*. This is my source code but it does not work. What am I doing wrong? A little background: I have a Project class that contains List of "CPTItem". The "ItemIndex" is a colum

[nhusers] Using Transient properties (not persistent/ mapped) in Interceptor after Session.Merge() #2658

2021-02-02 Thread Michal Krajcovic
Hi guys, lately I ran into an issue when I'm using Interceptors derived from EmptyInterceptor to generate some properties (i.e. Created and LastModified) on my entities. For some use cases I don't want to regenerate those values so I have transient (not persistent) property and in Intercepto

[nhusers] Re: Custom ProxyFactoryFactory - IsInstrumented

2011-05-08 Thread michal
Understood. Thank you for your help ! On 6 Maj, 16:37, Fabio Maulo wrote: > If you don't need lazy-property feature then do the same you are seeing in > Linfu proxy factory. > > > > > > > > > > On Fri, May 6, 2011 at 11:16 AM, michal wrote: > > Ye

[nhusers] Re: Custom ProxyFactoryFactory - IsInstrumented

2011-05-06 Thread michal
w features ? ) On 6 Maj, 15:40, Fabio Maulo wrote: > you can put true and return a proxy in GetFieldInterceptorProxy. > More than that, we have to know which is the target of your custom > proxyfactoryfactory (95% of users does not need a custom proxy factory). > > > On Fri, Ma

[nhusers] Re: Custom ProxyFactoryFactory - IsInstrumented

2011-05-06 Thread michal
operties > > > > > > > > > > On Fri, May 6, 2011 at 9:16 AM, michal wrote: > > Hi > > > I am using custom ProxyFactory in my project (it is based on the one > > from the old Proxy Generators project). I almost finished to make it > > co

[nhusers] Custom ProxyFactoryFactory - IsInstrumented

2011-05-06 Thread michal
Hi I am using custom ProxyFactory in my project (it is based on the one from the old Proxy Generators project). I almost finished to make it compatible with NH 3.1 (used 2.1.2 before) , only one thing is left. There is new method "IsInstrumented" in the IProxyFactoryFactory interface. I saw it is

[nhusers] Re: Map generic entities independently on type parameter(s)

2010-01-01 Thread Michal Pavlík
Yes, I was afraid of this answer. However thank you :) On 1 led, 21:16, Fabio Maulo wrote: > in NH you can map only "concrete" types or "nothing". > > P.S. > "concrete" = the type available for a new (you can't do : var a = new > YouClass();

[nhusers] Map generic entities independently on type parameter(s)

2010-01-01 Thread Michal Pavlík
into one table independently on type parameter? I tried google but without luck. Thanks and excuse my English, Michal -- 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 un

[nhusers] Re: getting the parent and number of child entities

2009-11-02 Thread Michal Drozd [toper]
named querries for now. Fabio, Oscar, thanks for your help. On Oct 29, 1:42 pm, Fabio Maulo wrote: > Good alternative... > Michal, as you can see, to have a good solution people need a better > explanation. ;) > -- > Fabio Maulo --~--~-~--~~~---~--~---

[nhusers] Re: getting the parent and number of child entities

2009-10-28 Thread Michal Drozd [toper]
Any ideas? the sql seems simple: select p.*, isnull(c.cnt, 0) from parent p left join (select parentid, count(childid) as cnt from children group by parentid) c on p.id = c.parentid --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

[nhusers] Re: getting the parent and number of child entities

2009-10-28 Thread Michal Drozd [toper]
Hi Fabio, I tried that , but it fails (I am using nh test project): The query string is: "select s, size(s.Enrolments) from Student s", and the exception: NHibernate.Test.Criteria.ProjectionsTest.GetStudentAndCountOfEnrolments: NHibernate.ADOException : could not execute query [ select student0_

[nhusers] getting the parent and number of child entities

2009-10-27 Thread Michal Drozd [toper]
= c.parentid Is it possible to get the List of pairs { Parent, ChildrenCount } using current NH.Linq implementation? Or using HQL and then AliasToBean result transformer? I tried both without any luck.. thanks, Michal --~--~-~--~~~---~--~~ You received this message because

[nhusers] Inheritance of mapping info

2009-10-10 Thread Michal Pavlík
t; this mapping info in derived classes? And one important thing - interface is in separated project (module) and doesn't know about derived entities in another modules. Thanks and excuse my English. Michal --~--~-~--~~~---~--~~ You received this mes

[nhusers] Re: join and subquery problem - bug or feature ?

2009-07-30 Thread michal
gt; > > 2009/7/30 michal > > > > > > > Hello > > > After migration from NH 2.0.1 to 2.1.0 , I have huge problem with HQL > > joins. They worked well in 2.0.1. > > > For example : > > There are three classes : Mas, Det, El  . Det has many-t

[nhusers] join and subquery problem - bug or feature ?

2009-07-30 Thread michal
Hello After migration from NH 2.0.1 to 2.1.0 , I have huge problem with HQL joins. They worked well in 2.0.1. For example : There are three classes : Mas, Det, El . Det has many-to-one relation to Mas. Mas has many-to-may relation to El. HQL: select d from Det d where (SELECT count(e) FROM d.M

[nhusers] Re: ProxyGenerators

2009-07-22 Thread michal
me great performance boost. So I hope someone will update NHPG, because I don't think I am able to do it myself ... Regards, michal On 21 Lip, 17:19, Bill Pierce wrote: > Hey Michal, > NHPG hasn't been touched in many months.  There is a high probability > it will need to be up

[nhusers] ProxyGenerators

2009-07-21 Thread michal
quot; . I don't understand it, it was working perfect before, with NH 2.0.1 . Regards, michal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nh

[nhusers] Re: Multi language implementation

2009-06-24 Thread Michal Gabrukiewicz
sure why not. i guess i need some access to it ... best regards michal On Thu, Jun 25, 2009 at 12:06 AM, Fabio Maulo wrote: > 2009/6/24 Michal Gabrukiewicz > >> here is a detailed description of how i did solved the multi language >> problem: >> http://www.webdevbros

[nhusers] Re: Multi language implementation

2009-06-24 Thread Michal Gabrukiewicz
here is a detailed description of how i did solved the multi language problem: http://www.webdevbros.net/2009/06/24/create-a-multi-languaged-domain-model-with-nhibernate-and-c/ > On 15 Apr., 14:42, Michal wrote: > > On Apr 14, 8:14 pm, Yaojian wrote: > > > > > I w

[nhusers] Shared collections on self-referencing tree

2009-06-03 Thread Michal
hi all. I have a tree structure of Folders (parent child) and each folder can be tagged with a tag (Tags collection of Folder). That's all fine .. Now I would like that all children folders have the same tags as the parent ... Basically I just need to point the Tags collection to the one of the

[nhusers] Re: Maintain index of list

2009-06-02 Thread Michal
My children are stored in an IList implemented by List as i need to preserve order of the children On Jun 2, 4:18 pm, Oskar Berggren wrote: > What list are you talking about? > > /Oskar > > 2009/6/2 Michal : > > > > > Looks like I have solved it now ... it was an i

[nhusers] Re: Maintain index of list

2009-06-02 Thread Michal
Looks like I have solved it now ... it was an issue of cascades ... I had all-delete-orphan on the Parent and Childs ... Changed it to "all" and now it seems to work ... Could someone explain me why is that .. I am afraid I dont :) On Jun 2, 3:15 pm, Michal wrote: > Hi all,

[nhusers] Maintain index of list

2009-06-02 Thread Michal
Hi all, I have am experiencing very strange behavoir on my self-referencing- tree when moving nodes around. + Root ++ Node 1 +++ Node 1.1 ++ Node 2 What are the steps required when moving a sub tree into another part of the tree (e.g. Moving Node 2 into Node 1.1) currently i am doing the follow

[nhusers] Mapping revisions of records

2009-05-25 Thread Michal
Hi all, I was wondering how would you map the following problem: An Order has a Comment (which is always the latest comment). It's possible to add a new comment which will replace the current (latest) comment. But I would like to still be able to ask the Order for all (history) comments. What's

[nhusers] Re: Fulltext search

2009-05-24 Thread Michal
Thanks Fabio for your quick reply! That helps a lot ... especially because it looks powerful! greets On 25 Mai, 00:24, Fabio Maulo wrote: > 2009/5/24 Michal > > > > > hi everyone, > > > I was wondering how you solve fulltext search when using nhibernate? > > I

[nhusers] Fulltext search

2009-05-24 Thread Michal
hi everyone, I was wondering how you solve fulltext search when using nhibernate? Is it possible? Thanks for any advice michal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to

[nhusers] Re: HQL help needed: order by item in map

2009-05-17 Thread Michal
: > from Industry industry > where index(industry.AllNames) = :lcid > order by industry.AllNames > > On 15 май, 06:03, Michal wrote: > > > Hi, > > > I have the following mapping of my "Industry" object: > > > > > > >   > > &g

[nhusers] Re: HQL help needed: order by item in map

2009-05-17 Thread Michal
: > from Industry industry > where index(industry.AllNames) = :lcid > order by industry.AllNames > > On 15 май, 06:03, Michal wrote: > > > Hi, > > > I have the following mapping of my "Industry" object: > > > > > > >   > > &g

[nhusers] Re: HQL help needed: order by item in map

2009-05-17 Thread Michal
rom Industry industry > where index(industry.AllNames) = :lcid > order by industry.AllNames > > On 15 май, 06:03, Michal wrote: > > > Hi, > > > I have the following mapping of my "Industry" object: > > > > > > >   > > &g

[nhusers] Re: Nhibernate.Validator validating entity components?

2009-05-15 Thread Michal
Thanks Jose for that link!! When I mark the Property (which contains the component) with [Valid] then it works fine. Exactly what i was looking for. Greets On May 15, 5:22 pm, José Salvador wrote: > I think you could have the same problem than me. > > Seehttp://groups.google.es/group/nhusers/br

[nhusers] Nhibernate.Validator validating entity components?

2009-05-15 Thread Michal
I am using NHibernate.Validator on an entity which contains a component. I was wondering if it is somehow possible to validate the component automatically if the "parent" entitiy is being validated. greets --~--~-~--~~~---~--~~ You received this message because you

[nhusers] HQL help needed: order by item in map

2009-05-14 Thread Michal
Hi, I have the following mapping of my "Industry" object: Now I would like to query all Industries ordered by the element of a given culture_id. I am stuck here ... I think i am close with this, but it does not work: string query = "f

[nhusers] Generator increment on property

2009-05-10 Thread Michal
Hi, I am aware of the increment generator for ID columns .. I would require the same behavoir for a normal property. My domain object has a property "Number" which should always be highest value + 1 on insert... Is there any nice solution? thanks!1 --~--~-~--~~~---~--

[nhusers] Re: Subclassing or not? (master templates)

2009-05-04 Thread Michal
This question has been answered here already: http://stackoverflow.com/questions/818964/model-a-master-template-inherit-or-not/819304#819304 The whole thing is referred as Prototype pattern. Now I know :) On May 4, 12:57 pm, Michal wrote: > Hi all, > > I have some tricky question, bu

[nhusers] Subclassing or not? (master templates)

2009-05-03 Thread Michal
Hi all, I have some tricky question, but am sure that it"s a common problem. Hope I am able to explain it well with my bad english :) Lets say we have a Workflow class which represents a workflow. An admin is managing the workflow structure (item a before item b, etc.). Which results in a master

[nhusers] Re: Custom sort order of items

2009-05-02 Thread Michal Gabrukiewicz
t; > 2009/5/2 Michal Gabrukiewicz > >> Hi Fabio, >> >> Thanks for quick response. as usual :) >> >> Sure the UI will be drag&drop with Wysiwyg, but the underlying structure >> requires a float for storing the position or does the list handle all this?

[nhusers] Re: Custom sort order of items

2009-05-01 Thread Michal Gabrukiewicz
one item. Then we need to maintain the position of all items (all product records will be updated) .. Am I right? Greetings from Bangkok On Sat, May 2, 2009 at 12:20 PM, Fabio Maulo wrote: > and forget the float... WYSIWYG is more easy. > > 2009/5/2 Michal > >> >> Hi, &g

[nhusers] Custom sort order of items

2009-05-01 Thread Michal
Hi, I was wondering how would you solve a custom ordering of items using NHibernate: Category has many Products where each products sort position can be customized by the user. - Currently I want to store the position as a float in order to make reordering easy. Which would result in an easy fo

[nhusers] Re: Use criteria API on a map

2009-04-28 Thread Michal
ry item) or the "culture_id" (dictionary key). thanks! On 28 Apr., 18:47, Germán Schuager wrote: > Why do you want to use criteria? > You can do this with hql like > this:http://www.nhforge.org/doc/nh/en/index.html#manipulatingdata-filtering > > On Tue, Apr 28, 2009 at 2

[nhusers] Use criteria API on a map

2009-04-27 Thread Michal
Hi, I am mapping a MAP in one of my domain objects the following way: so AllTitles is an IDictionary in my domain object. How can I create a criteria query which restricts the culture_id or the val of the map. E.g something like that. session.CreateCriteria(typ

[nhusers] Re: reload filter

2009-04-27 Thread Michal
Thanks Fabio.. I guess you are right. Do you have a suggestion how I could change that in order to use HQL/ Criteria? On Apr 27, 7:35 pm, Fabio Maulo wrote: > 2009/4/27 > > > They do in my case cause i am using them in formula. > > I know that somebody write something with a trick where a para

[nhusers] Re: reload filter

2009-04-26 Thread Michal
(Question)sess.Load(typeof(Question), 4); Assert.AreEqual("Wie ist dein Name?", q.Text, "German translation does not work"); sess.Transaction.Rollback(); sess.Flush(); sess.Close(); On Apr 25, 9:09 pm, Fabio Maulo wrote: > disab

[nhusers] reload filter

2009-04-25 Thread Michal
Hi, I am using filters for my session and would like to reload the filter's param value. How to do that? I am setting the filter like that session.EnableFilter("name").SetParameter("param", 1) now i would like to change the value from 1 to 2 for the upcoming queries ... when i just change it t

[nhusers] Re: Validation incl. validation summary

2009-04-15 Thread Michal
On Apr 14, 8:49 pm, Fabio Maulo wrote: > 2009/4/14 Michal > > > > > fabio could you provide me a specific example which would enforce > > business rules ... what objects would be required, where would the > > validation live, etc. > > Sure I can. Consultin

[nhusers] Re: Multi language implementation

2009-04-15 Thread Michal
; feature may helps if you want to expose the > name/address in one language only. It may be used to filter the Resources > with the current LanguageID. aight. Guess i have a clue what you are talking about. B 3.1 sounds good to me as well.. > > On Tue, Apr 14, 2009 at 8:14 PM, Michal w

[nhusers] Re: Multi language implementation

2009-04-15 Thread Michal
On Apr 14, 7:32 pm, cws wrote: > Hi! > > Wouldn't you use resources for that? so far i thought resources are only for translations of messages within the "code". Do you have a code sample? > > On 14 Apr, 14:14, Michal wrote: > > > Hello all, > >

[nhusers] Re: Validation incl. validation summary

2009-04-14 Thread Michal
fabio could you provide me a specific example which would enforce business rules ... what objects would be required, where would the validation live, etc. thx a ton On 14 Apr., 20:31, Fabio Maulo wrote: > 2009/4/14 Michal > > > > > Is there anything nhibernate can support me

[nhusers] Validation incl. validation summary

2009-04-14 Thread Michal
Hello, I am about to use nhibernat for my project and wondering how I would solve business logic validation of my classes. E.g. Before saving an instance I would like to check if its valid. If not I would like to show a validation summary which contains all broken rules. Is there anything nhibe

[nhusers] Multi language implementation

2009-04-14 Thread Michal
Hello all, I am completely new to hibernate and would be interested in the solution to the following problem: My application needs to support data in multiple languages. E.g A product contains a title which can be stored in English, German, Spanish, etc. Could you tell me the best practice of h