Re: [nhusers] Re: Friends, did you see this? A NH Designer!!!

2010-08-13 Thread Humberto Marchezi
@Fabio, Sometimes we have to integrate new systems (completely new data model) with a system that makes use of legacy data model. Given this situation, is it possible to mix ConfORM with XML-mapping ? @All community, The issue about many x few tech options go far beyond NHibernate. Choosing a ma

Re: [nhusers] using the '$'

2010-06-16 Thread Humberto Marchezi
In NHibernate, a class name can be anything you want since acceptable to C# therefore it doesn´t have to follow the tables names. For example, you could create a class named as OurCompanyXItem where X is ouyr naming convention for $. On Wed, Jun 16, 2010 at 5:23 PM, Yonah Wahrhaftig wrote: > Us

Re: [nhusers] Re: How to write Criteria query with a formula in the ORDER BY?

2010-04-07 Thread Humberto Marchezi
Well, I dont see a reasons for why not use HQL in this case. If I am not mistaken this query below is actually an HQL query. I have tested this query with different classes here and it seems to have worked. select s.Id, s.Name, sum(q.PointsObtained), sum(q.TotalPoints) from Student s join s.Quest

Re: [nhusers] Re: NH selects same column multiple times

2010-04-07 Thread Humberto Marchezi
Last time I had this problem was due to differences in column names such as idAddress and idaddress. I suggest to check if all column names are following the same name convention. You can use a regular expression in *.hbm.xml such as that: * column\="[A-Z][a-zA-Z0-9~]+" (first letter of the column

Re: [nhusers] Class Diagram and ERD

2010-03-12 Thread Humberto Marchezi
Because NHibernate abstracts the data concern so well as an Analyst/Programmer I don´t need ERD´s very often. I guess that is the strength of this tool to let us to get rid of ERD at least for business purposes. The class diagram shows a general overview of the business structure and are used by a

Fwd: [nhusers] Mapping same column as property and relationship ("Index out of range error")

2010-03-10 Thread Humberto Marchezi
Hi epitka, One complementary way to minimize this problem is to create views in the new database. These views can map the old tables at the same time that it makes use of data model formatting from the new database and thus NHibernate don´t need to do too much "gymnastics". -- Forwarded

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

2010-03-03 Thread Humberto Marchezi
Humberto C. Marchezi, Vitória, Brazil. Ironically to our friend in Montana I am fed up of being toasted by the weather here. On Wed, Mar 3, 2010 at 6:20 PM, Josh Coffman wrote: > @joshcoffman > AZ, USA ..for now anyway > > > Josh C. > 480-270-4578 | josh [at] computeristsolutions [dot] com |

Re: [nhusers] Configure NHibernate Async

2010-02-24 Thread Humberto Marchezi
hank you all for your suggestions.. Sure im gonna check all of that. > > @Humberto Marchezi > *Well its not just Nhibernate i am loading at startup.. Im using an IoC > container and registering all of my dao,services,views,presenters etc. That > is why i am looking for a way to load all of

Re: [nhusers] Configure NHibernate Async

2010-02-23 Thread Humberto Marchezi
Hi Reggieboy, Are you sure it is NHibernate who is slowing your app down ? You need a very large number of entities in order to feel it. Just to give you an idea I have a Winform application with almost 1000 entities but no sensitive slow down in the initialization or any other part. On Tue, Feb

[nhusers] Re: Annotations or hbm.xml files

2009-11-13 Thread Humberto Marchezi
Hello Fernando, Generally speaking: *.hbm.xml : - Best option when you need flexibility between data model and object model. - Usually also best for legacy data models *Fluent Automapper: - Best option when data model will follow the object model - Best option if you need speed and you dont want

[nhusers] Re: Most Urgent Issue :NHibernate + Remoting + LazyLoading - Has anyone gotta workaround??

2009-10-26 Thread Humberto Marchezi
Hi, Is it useful for you: http://lunaverse.wordpress.com/2007/05/09/remoting-using-wcf-and-nhibernate/ On Fri, Oct 23, 2009 at 8:35 AM, SGK wrote: > > Thanks.. > Let me put my scenario again this way.. > My application looks like a client - server - database. > Server will handle all data relat

[nhusers] Re: session gets NULL when my program makes use of Castle Dynamic Proxy

2009-10-19 Thread Humberto Marchezi
Hi, If somebody is interested. I moved to Dynamic Proxy 2 and the problem disappeared. Apparently it is a bug in Castle Dynamic Proxy 1. On Fri, Oct 16, 2009 at 10:26 AM, Humberto Marchezi wrote: > Hi, > > I use Castle Dynamic Proxy to insert aspects in the system we are doing >

[nhusers] Re: mapping many-to-many to System.Collections.Generic.IList

2009-10-16 Thread Humberto Marchezi
Another alternative for IList collections, is to use in your mappings. On Fri, Oct 16, 2009 at 3:44 PM, Fabio Maulo wrote: > Use ICollection and > btw I don't understand all those "NOT". > MS has understand that we need a Set semantic in C#3.0 and then they > understand that we need ISet (inte

[nhusers] session gets NULL when my program makes use of Castle Dynamic Proxy

2009-10-16 Thread Humberto Marchezi
Hi, I use Castle Dynamic Proxy to insert aspects in the system we are doing here so that we don´t have to repeat the exception and session management code block all over the system. However the managed session is replaced with null value when the actual method gets called. See the code listing be

[nhusers] Re: Question about NH (Hydrate) performance

2009-09-03 Thread Humberto Marchezi
Hi Ricardo, Search for stateless session in NHibernate. Also, read this: http://ayende.com/Blog/archive/2009/08/15/benchmarks-are-useless-yes-again.aspx sds On Wed, Sep 2, 2009 at 10:17 AM, Ricardo Pedro wrote: > > Hi to everyone. > > I'm an user of NH and I'm using it in lot's of personal an

[nhusers] Re: An idea for simple and clean session/transaction/exception management with NHibernate for Winforms and Web apps

2009-08-31 Thread Humberto Marchezi
er I understand that conversation implementation is out of the scope of NHibernate. I was just trying to think about a way to increase the adoption of NHibernate among "regular" developers. On Mon, Aug 31, 2009 at 10:00 PM, José F. Romaniello wrote: > 2009/8/31 Humberto Marchezi > >

[nhusers] Re: An idea for simple and clean session/transaction/exception management with NHibernate for Winforms and Web apps

2009-08-31 Thread Humberto Marchezi
, 2009 at 2:58 PM, José F. Romaniello wrote: > Did you see this? > http://fabiomaulo.blogspot.com/2009/01/aspect-conversation-per.html > > 2009/8/28 Humberto Marchezi > > Hi Community, >> After spending a lot of time (months) trying ideas and frameworks to find >>

[nhusers] An idea for simple and clean session/transaction/exception management with NHibernate for Winforms and Web apps

2009-08-28 Thread Humberto Marchezi
Hi Community, After spending a lot of time (months) trying ideas and frameworks to find a way to manage sessions and transactions for both win and web apps I found the idea of dynamic proxies very interesting. I am using this idea from now on. I would like to hear your feedback about it. Have some

[nhusers] Re: two table grid binding

2009-08-19 Thread Humberto Marchezi
Hello, Tipically I would create some DAO class *NHibernateTitleDAO *with a method like *GetTitles( ) : IList . The HQL would be implemented inside populating the list of DTOs. Search for DAO design pattern and DTO for more details. *PS:* I guess this would be an example of OO thinking. On Wed,

[nhusers] Re: Some questions about Session Management

2009-08-15 Thread Humberto Marchezi
est is simply something that can't enter in my mind. > > About have something like ConnectionManager.Open() > and ConnectionManager.BeginTransaction() inside the code of a > button_click... No comment. > > > 2009/8/14 Humberto Marchezi > >> Several requests from differe

[nhusers] Re: Some questions about Session Management

2009-08-14 Thread Humberto Marchezi
ttp://tunatoksoz.com > http://twitter.com/tehlike > > > > > On Fri, Aug 14, 2009 at 5:16 PM, Humberto Marchezi > wrote: > >> Session > > > > > > -- Humberto C Marchezi - Master in Electrical Eng

[nhusers] Some questions about Session Management

2009-08-14 Thread Humberto Marchezi
Hi, I have seen a lot of examples about session management where the idea is trying to hide the ISession from the application ( as far as I understood ). However implementing session management seems to be a complex task and there is few documentation about how to do that that for both Winforms an

[nhusers] Re: LINQ for nHibernate vs. Field Mapping

2009-08-07 Thread Humberto Marchezi
It is a matter of using the right naming strategy. You can tell NHibernate to use your private field for "set" and your public property for "get". In order to to do it you must use the right access strategy. Look for naming strategy in NHibernate documentation for more details. sds On Fri,

[nhusers] Re: Odd exception - Unknown entity class:NHibernate.Collection.PersistentBag

2009-06-05 Thread Humberto Marchezi
N-to-N associations can be tricky. Would list your mapping files ? On Fri, Jun 5, 2009 at 10:32 AM, Chris wrote: > > Not sure what WCF is? > > As for tests to recreate ... I don't have a small testbed at this > point. In general, NHibernate has been working for us, and continues > to do so, it's

[nhusers] Re: How could we enhance NH's documentation?

2009-05-18 Thread Humberto Marchezi
Documentation of a not-so-trivial tool like NHibernate is definitely an important issue. Provided of good documentation NH can become even more popular. I think there are some gaps to be filled such as: - More detailed explanation about collections. There are sets, maps, lists and bags but what a

[nhusers] Persistence Layer and DTOs

2009-03-19 Thread Humberto Marchezi
Hi all, We worked with layered architecture: - UI Layer - Service Layer - Domain Layer - Persistence Layer A layer can only access its immediately inferior layer. Thus service layer can not access persistence layer directly. The problem is that our DTOs classes are associated to the service laye

[nhusers] Re: NH Design Question - Ignoring Field Validation when reading from Database

2009-03-13 Thread Humberto Marchezi
ing-declaration-> > mapping)... > > I believe what you are looking for is access="nosetter.camelcase- > undescore" or "field.camelcase-underscore" > > LINQ-to-NH is based on the mapping files, so how you access your > objects has nothing to do with LI

[nhusers] Re: NH Design Question - Ignoring Field Validation when reading from Database

2009-03-12 Thread Humberto Marchezi
for a Name property and _name field in the class Person: *<-- NHibernate can use _name for writing -->* *<-- Name property (get) is not used for inserts or updates but for Linq-to-NHibernate -->* On Thu, Mar 12, 2009 at 10:48 AM, Humberto Marchezi wrote: > Ma

[nhusers] Re: NH Design Question - Ignoring Field Validation when reading from Database

2009-03-12 Thread Humberto Marchezi
gt; 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:/

[nhusers] Re: NH Design Question - Ignoring Field Validation when reading from Database

2009-03-12 Thread Humberto Marchezi
So would you say that field accessor is better practice than property accessor ? What about Linq-to-NHibernate, will I be able to use it with field accessor mappings ? On Thu, Mar 12, 2009 at 8:39 AM, Ayende Rahien wrote: > field accessor > > > On Thu, Mar 12, 2009 at 4:38 PM, Humbe

[nhusers] NH Design Question - Ignoring Field Validation when reading from Database

2009-03-12 Thread Humberto Marchezi
Hi, Suppose I have a class: public class Person { private string _name; public virtual string Name { set { if (_name == string.Empty) throw new NameInvalidException(); _name = value; } } Name property prevents a person to have an empt

[nhusers] Re: Mapping read-only entites without id

2009-03-06 Thread Humberto Marchezi
Hi, I can think of two options for your problem: 1 - Adding a primary key as an incremental column in your Fact Tables or 2 - Create a composite-id for the Fact Tables from all the Foreign keys ( if it defines a unique identification ) Personally I would take option 1 since it is simpler to map

[nhusers] Re: Mapping a class with two mapping files

2009-02-20 Thread Humberto Marchezi
?Please try to explain better >> what you are looking for. >> >> 2009/2/20 Humberto Marchezi >> >>> Hi community, >>> >>> Let´s I have a domain class Person in the assembly PersonDomain.dll and I >>> have its extension methods AddDocu

[nhusers] Mapping a class with two mapping files

2009-02-20 Thread Humberto Marchezi
Hi community, Let´s I have a domain class Person in the assembly PersonDomain.dll and I have its extension methods AddDocument, RemoveDocument, GetDocuments, etc.. a separated assembly DocumentDomain.dll . I have a Mapping file Person.hbm.xml for Person in PersonDomain.dll working fine however I

[nhusers] Re: Business Objects vs. mapped Classes

2009-02-19 Thread Humberto Marchezi
Hi, Very interesting project. I want to use Linq-to-Sql entities as a Data Layer while my real Business Classes are in the Domain Layer. I am wondering if automapper can map Linq-to-Sql generated entities to Business entities in the Domain Layer. Have anybody tried this or if this project is help

[nhusers] Re: Access denied on NHibernate.dll

2009-02-11 Thread Humberto Marchezi
Hi, Well, I never heard of and had this problem all this time with NHibernate. Actually it does not seem to be related to NHibernate. There is probably something wrong when you try to deploy your web app. In my case all external dlls ( which includes NHibernate ) are located in a separated directo

[nhusers] Re: Smart Grids and NHibernate

2009-01-29 Thread Humberto Marchezi
SP.NET or Smart (Forms/ WPF...) ? > > > > Selon Humberto Marchezi : > > > Exactly, it is a Person entity with a bag of Documents. The reason why I > am > > asking this is that I am trying to use a DDD approach to implement this > > system by using an architecture lik

[nhusers] Re: Smart Grids and NHibernate

2009-01-29 Thread Humberto Marchezi
client are you using ? > > ASP.NET or Smart (Forms/ WPF...) ? > > > > Selon Humberto Marchezi : > > > Exactly, it is a Person entity with a bag of Documents. The reason why I > am > > asking this is that I am trying to use a DDD approach to implement this > >

[nhusers] Re: Smart Grids and NHibernate

2009-01-28 Thread Humberto Marchezi
bove. On Wed, Jan 28, 2009 at 10:19 PM, Frederic wrote: > > Humberto Marchezi a écrit : > > Hi, > > > > I want to build a Person Registration Application whose UI has a Grid > > of Personal Documents. > > Documents can be added, removed or altered in the Pe

[nhusers] Smart Grids and NHibernate

2009-01-28 Thread Humberto Marchezi
Hi, I want to build a Person Registration Application whose UI has a Grid of Personal Documents. Documents can be added, removed or altered in the Person object only in * memory*. At the end of the process, the person is saved to the database with its documents. I want to apply business rules (va

[nhusers] Re: mapping a deeper hierarchy

2009-01-06 Thread Humberto Marchezi
Hi Jan, I think the solution also depends on what kind of data modeling you are using for your hierarchy: it is one table for the entire hierarchy or one table per class ? Usually I use one table per class strategy and I don´t have problems mapping deeper hierarchies with . On Mon, Jan 5, 2009

[nhusers] Re: Default constructor requirement.

2009-01-01 Thread Humberto Marchezi
Hi, Is it really a good idea to validate instances retrieved from the database ? For me, it sounds like a non-robust software. Imagine if someone or some external system performs updates in the database that breaks your constraints. Will your software trigger exceptions all the time whenever an "

[nhusers] Re: Generating Entity Classes from Database Model

2008-11-20 Thread Humberto Marchezi
Correction: 'We have been using NHibernate only by manually implementing the POCO and XML mappings.' On Thu, Nov 20, 2008 at 11:00 AM, Humberto Marchezi <[EMAIL PROTECTED]>wrote: > You all are definetely right. You have been using NHibernate only by > manually impleme

[nhusers] Re: Generating Entity Classes from Database Model

2008-11-20 Thread Humberto Marchezi
> AjGenesis > > and perhaps there are something more but > > The best tool is your mind and your hands trough your keboard > > > > 2008/11/20 Humberto Marchezi <[EMAIL PROTECTED]> > >> > >> Hello, > >> > >> Does anyone know

[nhusers] Generating Entity Classes from Database Model

2008-11-20 Thread Humberto Marchezi
Hello, Does anyone know something about a utility program that lets me to generate Entity Models (POJO classes) (including *.hbm.xml mappings) from a SQL scheme ? I guess there was an utility called sql2hbm or something like this ... but i can´t find it. Thanks a lot. -- Humberto C Marchezi --