[nhusers] Nhib 3.3: Merge of detached object + Lazy loaded (and created) details collection -> exception on flash "A collection with cascade="all-delete-orphan" was no longer referenced ....."

2013-08-23 Thread Alexander Kot
Hello This is rare situation but is that bug or feature? I have detached object with lazy details something like public class Ent { public virtual ISet Details { get { return (_details ?? (_details = new HashSet())); }

[nhusers] Re: Potential pitfalls to using a shared SessionFactory in a multi-tenant application

2012-10-24 Thread Alexander Kot
Hello We are using not 1 SF for each tenant but 1 SF per tenant based on common Configuration. For us there 1 blocking feature to use shared SF - HiLo Id generator (both standard and extended) HiLo generator for entity is global per SF not per session, so in case of MultiTenancy with shared S

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

2012-06-25 Thread Alexander Kot
Hello all Please vote for this one... https://nhibernate.jira.com/browse/NH-2463 > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/KckovYFd52kJ. To post to this gr

[nhusers] Re: NHibernate 3.2 GA + WCF Data Services = NHibernate.QueryException, Duplicate definition of alias

2012-02-24 Thread Alexander Kot
Hello Please vote for https://nhibernate.jira.com/browse/NH-2463 (exception has changed a little since I have try it last time) -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg

[nhusers] Is taht possible to generate xml mapping from NHibernate.Cfg.Configuration object?

2011-11-03 Thread Alexander Kot
Hello all When I use mapping by code in NH 3.2 I can extract xml mapping from HbmMapping *mapping *= _mapper.CompileMapping before sending it to configuration object But after cfg.AddMapping(mapping); I apply NH.validators to fine tune mapping in cfg and then I want to see final mapping which

[nhusers] NH 3.2 Mapping by code convention and collection of components

2011-10-26 Thread Alexander Kot
Hello all It seems that BeforeMapComponent do not called when component used in any collection type Is that feature of bug? It seem to me that if i want to have conventional bidirectional collection of components i need to specify somewhere Parent for component and Before/After MapComponent loo

Re: [nhusers] Envers & SetForNet4 do not work together

2011-10-26 Thread Alexander Kot
Thanks I have found it https://bitbucket.org/RogerKratz/nhibernate.envers.setfornet4 -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/h7CcT5Ui68kJ. To post to this gr

[nhusers] Envers & SetForNet4 do not work together

2011-10-25 Thread Alexander Kot
Hello all Have anybody tried to use Envers with .Net 4 ISet based on http://nhforge.org/blogs/nhibernate/archive/2011/03/15/using-lt-set-gt-in-mappings-without-iesi-collections-net-4.aspx ? I have tried and it do not work together It works for creating audit entries with small modification of Se

[nhusers] Re: NH3.2 Bidirectional 1:N & Inverse & Dictionary problem

2011-10-25 Thread Alexander Kot
Thank you for replies It seems to me that "not support" there is too strong word It do not support it with Inverse=true on master side And support it somehow (with not optimal SQLs and really 2 relation mapped to 1 FK column) I have tried: "You could add not-null="true" to the element of your

[nhusers] NH3.2 Bidirectional 1:N & Inverse & Dictionary problem

2011-10-20 Thread Alexander Kot
Hello all I want to implement Bidirectional Master Detail relation using IDictionary collection When such relation marked as Inverse= false all works good NH generate SQLs: INS Master...; INS Detail (Including FK col to master, *IDX index of collection not included in SQL*); UPD detail (SET FK

Re: [nhusers] Envers 1.0 and unidirectional OneToMany association some questions

2011-10-18 Thread Alexander Kot
Done 1-2) https://nhibernate.jira.com/browse/NHE-36 3) https://nhibernate.jira.com/browse/NHE-37 -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/CnJcwr2uUkEJ. To po

Re: [nhusers] Do Enverse will support Collections of components in predictable future?

2011-10-18 Thread Alexander Kot
https://nhibernate.jira.com/browse/NHE-38 Envers is great components for supporting audit in NH project but absence of this function cause strong restriction for modeling Entities of problem domain If we want audit we need in many cases redesign existing model And for using instead of components

[nhusers] Envers 1.0 and unidirectional OneToMany association some questions

2011-10-17 Thread Alexander Kot
Hello all If unidirectional OneToMany association is used class TMaster{ public virtual IDictionary Details } TMaster mapped to T1 table TDetails mapped to T2 Then Envers generate next tables for audit T1_AUD T2_AUD *TMaster_TDetails_AUD*As i understood this is used for tracki

Re: [nhusers] Do Envers 1.0 support unidirectional OneToMany association?

2011-10-14 Thread Alexander Kot
Thank you for help That is exactly what has happened. After converting collection of components to collection of entities i has added Inverse to such relations in convention. And then have been trying to generate DB schema with audit tables, without checking behavior of model without audit. --

Re: [nhusers] Do Envers 1.0 support unidirectional OneToMany association?

2011-10-14 Thread Alexander Kot
This exception generated in CollectionMetadataGenerator.GetMappedBy(Mapping.Collection collectionValue) and if we are in this method - back ref must exists or it will be exception I see main difference in my code\ integration test in using fluent\ by attribute configuration respectively Will cont

Re: [nhusers] Do Envers 1.0 support unidirectional OneToMany association?

2011-10-14 Thread Alexander Kot
Thank you for replay - i will explore it deeper on Monday and will try to create test My mapping is generated by 3.2 convention and it is Map for public virtual IDictionary Addresses . and Envers integration looks like var enversFluentCfg = Model.Components.Resolve();

[nhusers] Do Envers 1.0 support unidirectional OneToMany association?

2011-10-14 Thread Alexander Kot
Hello all It seems it does not After converting collection of components to collection of entities In my example project i have NHibernate.MappingException: Unable to read the mapped by attribute for XXX in YYY ! exception if XXX 1:N YYY this error disappear when adding backref from YYY to XXX

[nhusers] Do Enverse will support Collections of components in predictable future?

2011-10-12 Thread Alexander Kot
Hello all In Enverse doc 9.2. What is not and will be supported 1. Collections of components May be somebody knows is there any plan to implement this in nearest future? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on

[nhusers] Mapping by Convention in 3.2 : Why ConventionModelMapper can use only SimpleModelInspector?

2011-09-28 Thread Alexander Kot
Hello all In ConventionModelMapper we can see public ConventionModelMapper() : base(new SimpleModelInspector()) and no ability to use other IModelInspector implemetation (derived for example from SimpleModelInspector) then protected SimpleModelInspector SimpleModelInspector { get { return (

[nhusers] NH 3.2 Mapping by code - How to specify FK name when mapping 1:1?

2011-09-02 Thread Alexander Kot
Hello all I am playing with subj .. OneToOne(x => x.Master, map => { map.Constrained(true);}); I cannot fined where i can define name for FK constraint if it is used. Any ideas? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discu

[nhusers] Re: Mapping by code convention in NH 3.2 and table for splited properties

2011-08-31 Thread Alexander Kot
Hello I want to do as more as possible using mapping by code using convention. When i use table per subclass strategy for mapping inherited classes i can define Table name, PK column name, FK derived -> base in mapper.BeforeMapJoinedSubclass An i do this like mapper.BeforeMapJoinedSubclass +=

[nhusers] Mapping by code convention in NH 3.2 and table for splited properties

2011-08-29 Thread Alexander Kot
Hello all I cannot fined in NH3.2 ConventionModelMapper in Before/After events place for customizing table used for splited property. I can define in my explicit mapping map.Join("MyClassSplit1", mj=> {

[nhusers] Re: NHibernate + OData Projections Not Supported

2011-08-29 Thread Alexander Kot
Hello Please vote for this bug https://nhibernate.jira.com/browse/NH-2463 It has change exception message a little, but that is the same problem Details there: https://groups.google.com/forum/#!topic/nhusers/FCuVUO_lC-4/discussion It seems next is also connected problem https://groups.google.com

[nhusers] Re: Mapping by code convention bags and so on

2011-08-18 Thread Alexander Kot
It seems to me that i have found answer to 1st question myself m_mapper.BeforeMapElement += (insp, prop, map) => { ... map.Column(cm => cm.Name("Element")); }; What about 2d one? -- You received this message because you are subscribed to the Google Groups

[nhusers] Mapping by code convention bags and so on

2011-08-18 Thread Alexander Kot
Hello all I am playing with 3.2 mapping by code convention I have public class MyEntity : Entity { .. public virtual IEnumerable LinesBag { get; set; } } And next mapping: m_mapper.BeforeMapBag += (insp, prop, map) => { var tn = String.Concat(prop.GetContainerEntity(in

Re: [nhusers] Re: Mapping by code, avoid the map of some properties

2011-08-16 Thread Alexander Kot
Thank you I know that this is possible using mapper.IsPersistentProperty But that is not i want to do. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/E9eiskYpcK4J.

[nhusers] Re: Mapping by code, avoid the map of some properties

2011-08-16 Thread Alexander Kot
Hello Do I understood right that there is no way to specify that property should not be mapped in mapper.Class(. or in public class MyEntityMap : ClassMapping .. when mapper is ConventionModelMapper ? I want to do next Describe as much as possible in convention and then describe only

[nhusers] Re: Mapping by code conventions in NH 3.2 & .Version(...)

2011-08-15 Thread Alexander Kot
Yes it seems that i have already found .IsVersion - it has same effect But why i need to specify IsVersion explicitly? I see that BeforeMapClass is called before mapping properties of this class :), so info about which property is version already accessible by core at the moment of property ma

[nhusers] Mapping by code conventions in NH 3.2 & .Version(...)

2011-08-15 Thread Alexander Kot
Hello all I am playing with mapping by code convention in 3.2 I would like to implement next: If there is int Ver {...} property in class use it for versioning. I do next: ConventionModelMapper m_mapper = new ConventionModelMapper(); m_mapper.BeforeMapClass += (mi, t, map) =>

[nhusers] Re: NH 3.0 GA & WCF Data services -> LINQ & SelectMany

2011-03-29 Thread Alexander Kot
Hello all in NH 3.1 SelectMany was fixed in Remotion so this query works var l3 = ses.Query().Where(s => s.Id == new Guid("")).SelectMany(s => s.Details1).ToList(); but this do not help for WCF Data Services request execution :( Like http :// localhost: 2711/TestWcfDataService.svc/TestEnti

Re: [nhusers] NH 3.0 GA & WCF Data services projection -> ?LINQ? Bug

2010-12-15 Thread Alexander Kot
http://216.121.112.228/browse/NH-2463 Unfortunately i cannot found how or do not have rights to close\remove initial -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhus..

Re: [nhusers] NH 3.0 GA & WCF Data services projection -> ?LINQ? Bug

2010-12-15 Thread Alexander Kot
Done http://216.121.112.228/browse/NHLQ-84 -- 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 op

[nhusers] NH 3.0 GA & WCF Data services projection -> ?LINQ? Bug

2010-12-14 Thread Alexander Kot
Hello I continue to explore NH 3.0 GA + Remotion - 1.13.85 and WCF data services I try to use projection in OData something like http : //localhost : 2711/TestWcfDataService.svc/TestEntities?$select=Id,FldChar10 and it does not work and generate exception with big stack trace in NH & remotion c

[nhusers] Re: NH 3.0 GA & WCF Data services -> LINQ & SelectMany

2010-12-10 Thread Alexander Kot
When rebuilding NH with Remotion - 1.13.85 exception has changed to Internal in debugger: "No corresponding expression node type was registered for method 'System.Linq.Queryable.SelectMany'. Returned to browser: Could not parse expression 'value(NHibernate.Linq.NhQueryable`1[FRPT.TestXModule.BL.

[nhusers] Re: NH 3.0 GA & WCF Data services -> LINQ & SelectMany

2010-12-06 Thread Alexander Kot
Sorry but in original post example WCF DS links was converted to redirects It must be: Works for --h t t p: //localhost: 2711 / TestWcfDataService.svc/TestEntities //All entities --h t t p: //localhost: 2711 / TestWcfDataService.svc/ TestEntities(guid'...') //1 entity --h t t p: //loc

[nhusers] Re: NH 3.0 GA & WCF Data services -> LINQ & SelectMany

2010-12-06 Thread Alexander Kot
. > What you mean exactly with "not possible" ? > > -- > Fabio Maulo > > El 06/12/2010, a las 10:00, Alexander Kot escribió: > > > Hello > > > I have tried to combine NH 3.0 & WCF data services following this > > article > >http://weblogs.asp

[nhusers] NH 3.0 GA & WCF Data services -> LINQ & SelectMany

2010-12-06 Thread Alexander Kot
Hello I have tried to combine NH 3.0 & WCF data services following this article http://weblogs.asp.net/cibrax/archive/2010/08/13/nhibernating-a-wcf-data-service.aspx It works partially for requests like http://localhost:2711/TestWcfDataService.svc/TestEntities http://localhost:2711/TestWcfDataSer

[nhusers] Re: NH 3.0 b2 & nchar(10) on MSSQL2008 primary key

2010-12-02 Thread Alexander Kot
Thank you On Dec 2, 7:20 pm, Fabio Maulo wrote: > and/orhttp://code.google.com/p/unhaddins/source/browse/uNhAddIns/uNhAddIns/... > > > > On Thu, Dec 2, 2010 at 2:18 PM, Fabio Maulo wrote: > > type="AnsiString" > > > On Thu, Dec 2, 2010 at 2:14 PM, Alexand

[nhusers] Re: NH 3.0 b2 & nchar(10) on MSSQL2008 primary key

2010-12-02 Thread Alexander Kot
nchar <=== the cause that cannot be changed (legacy db) Is there way how to map such PK? On Dec 2, 7:00 pm, Fabio Maulo wrote: > nchar <=== the cause > the value in your classes "XX" is different than the value stored "XX   " > > On Thu, Dec 2, 2010 at 1:47

[nhusers] Re: NH 3.0 b2 & nchar(10) on MSSQL2008 primary key

2010-12-02 Thread Alexander Kot
database schema is primary (I do not generate it) it is legacy DB CREATE TABLE BANKS ( BANK_CODEnchar(8) NOT NULL, CONSTRAINT PK_BANKS PRIMARY KEY NONCLUSTERED (BANK_CODE ASC) ) go I have created tabl

[nhusers] NH 3.0 b2 & nchar(10) on MSSQL2008 primary key

2010-12-02 Thread Alexander Kot
Hello I am playing with NH 3.0 b2 I have entity with string PK Code Fluent mapping is used Id(x => x.Code).Column("CODE").Length(5).Not.Nullable().Unique().GeneratedBy.Assigned(); field code has nchar(5) type in DB Having such condition it will be next var lst = (from x in ses.Query

[nhusers] Re: Nhib 3.0 b2 LINQ and filtering by nullable column -bug

2010-11-25 Thread Alexander Kot
My colegue has found what was the problem. There was next code in our test project: class SessionInterseptor: EmptyInterceptor , ... { public override SqlString OnPrepareStatement(SqlString sql) { string s = sql.ToString(); s = s.

[nhusers] Nhib 3.0 b2 LINQ and filtering by nullable column -bug

2010-11-17 Thread Alexander Kot
Hello I am exploring LINQ in NHib 3.0b2 using MSSQL 2008 now and have found next situation: var q = from x in ses.Query() where x.FldInt == 1 select x; FldInt has type int? and mapped to nullable column in table Mapping done using Fluent NHibernate .. Map(x => x.FldInt).Column("ZTR_F

[nhusers] Re: Mapping string property, length attribute defined, real property length exceed defined one -> exception but with DB roundtrip

2010-06-11 Thread Alexander Kot
h kind of check and even more powerful you can use the > integration with NHibernate.Validator. > > On Thu, Jun 10, 2010 at 8:05 AM, Alexander Kot wrote: -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this

[nhusers] Mapping string property, length attribute defined, real property length exceed defined one -> exception but with DB roundtrip

2010-06-10 Thread Alexander Kot
Hello all I am currently exploring NH 2.1.2 + FNH. I am playing with exceptional situations and was surprised by Length behavior. If in my object string property length > length defined in mapping, when I persist my object I have exception raised in transaction.Commit() – OK; But that exception i