﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Jose Salvador commented on NHibernate Mapping - &lt;component/&gt;</title><description>Thanks and sorry for the inconvenience. I think you are talking about  a explicit nhibernate validator mailing list not the nhibernate group.
  
  
Best regards.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment23</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment23</guid><pubDate>Tue, 05 May 2009 14:33:05 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>[www.lmgtfy.com/?q=nhibernate+users+mailing+list](http://www.lmgtfy.com/?q=nhibernate+users+mailing+list)</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment22</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment22</guid><pubDate>Tue, 05 May 2009 12:12:35 GMT</pubDate></item><item><title>Jose Salvador commented on NHibernate Mapping - &lt;component/&gt;</title><description>Of course Ayende but... What is the mailing list you are refering to?
  
  
Could you show me the path to subscribe myself to the maling list?
  
  
Thanks in advance.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment21</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment21</guid><pubDate>Tue, 05 May 2009 11:47:53 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>Jose,
  
Please ask in the mailing list
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment20</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment20</guid><pubDate>Mon, 04 May 2009 18:51:49 GMT</pubDate></item><item><title>Jose Salvador commented on NHibernate Mapping - &lt;component/&gt;</title><description>I have arrived here from a google search I have done looking for a doc about nhibernate validator and value types. I mean:
  
  
class Foo : NHibernateEntityClass
  
{
  
  [NotNullNotEmpty]
  
  public string Prop1;
  
  public Bar bar;
  
}
  
  
struct Bar
  
{
  
  [NotNullNotEmpty]
  
  public string prop1;
  
}
  
  
With this code (it's only an example) if I validate the foo object the bar class validation at prop1 willl not execute and I can not decorate the bar property at foo class with the valid attribute which only acts over a nhibernate entity types...
  
  
Is there any way to get this whithout custom validator which decorates the bar property at foo class?
  
  
Can you help me?
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment19</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment19</guid><pubDate>Mon, 04 May 2009 18:45:40 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>Version in a component doesn't really make sense, so I would assume not.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment18</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment18</guid><pubDate>Tue, 21 Apr 2009 07:31:17 GMT</pubDate></item><item><title>Frank Quednau commented on NHibernate Mapping - &lt;component/&gt;</title><description>Ayende, 
  
do you know off-hand whether a "technical" field like version or timestamp or user stamps can appear in a "component" section, that way expressing regularly used fields by association, not by inheritance?
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment17</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment17</guid><pubDate>Mon, 13 Apr 2009 18:46:33 GMT</pubDate></item><item><title>Sumod commented on NHibernate Mapping - &lt;component/&gt;</title><description>Yeah, that worked with a ColumnPrefix on the [Nested], thanks!
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment16</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment16</guid><pubDate>Fri, 10 Apr 2009 13:44:57 GMT</pubDate></item><item><title>Dmitry commented on NHibernate Mapping - &lt;component/&gt;</title><description>@El Guapo
  
  
It's a legacy database where some one-to-one relations are mapped as many-to-one. I ended up mapping Address as an entity and implemented data constraints in the data access layer.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment15</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment15</guid><pubDate>Fri, 10 Apr 2009 00:35:21 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>El,
  
I neither know nor care much...
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment14</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment14</guid><pubDate>Thu, 09 Apr 2009 14:55:22 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>Sumod,
  
You can use more than one component, just use a different property.
  
  
for example:
  
  
{component name="ShippingAddress"}
  
{component name="BillingAddress"}
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment13</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment13</guid><pubDate>Thu, 09 Apr 2009 14:54:52 GMT</pubDate></item><item><title>El Guapo commented on NHibernate Mapping - &lt;component/&gt;</title><description>Back on topic...
  
  
Does Entity Framework have a feature or concept similiar to this?
  
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment12</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment12</guid><pubDate>Thu, 09 Apr 2009 12:37:12 GMT</pubDate></item><item><title>El Guapo commented on NHibernate Mapping - &lt;component/&gt;</title><description>Dmity, your database model is wrong. You said:
  
  
"I have a table Person (ID, Name) and a table Address (ID, PersonID, ...). A person can only have 1 address"
  
  
Your second statement does not agree with your first statement. You need to fix that, before attempting to model it.
  
  
  
  
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment11</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment11</guid><pubDate>Thu, 09 Apr 2009 12:36:21 GMT</pubDate></item><item><title>Sumod commented on NHibernate Mapping - &lt;component/&gt;</title><description>How would you map two address components in this example? Would the property name prevent reuse of same component class?
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment10</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment10</guid><pubDate>Thu, 09 Apr 2009 11:39:58 GMT</pubDate></item><item><title>pb commented on NHibernate Mapping - &lt;component/&gt;</title><description>I'm not talking about a parent child relationship, just a simple example of loading a collection of entities and then wanting to do CRUD on them. Delete is a special case and has to be handled differently than saveorupdate.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment9</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment9</guid><pubDate>Thu, 09 Apr 2009 01:38:42 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>Dmitry,
  
I think so, take a look at the xsd.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment8</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment8</guid><pubDate>Wed, 08 Apr 2009 21:46:04 GMT</pubDate></item><item><title>Dmitry commented on NHibernate Mapping - &lt;component/&gt;</title><description>Sorry for going off-topic but is there a way to have a one-to-one associations when the ID fields in the 2 tables are named differently. I could not find anything in the "NHibernate in Action" book or on Google.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment7</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment7</guid><pubDate>Wed, 08 Apr 2009 21:11:18 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>Dmitry,
  
This is not for a {component/}, you are looking for {one-to-one/}
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment6</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment6</guid><pubDate>Wed, 08 Apr 2009 19:38:27 GMT</pubDate></item><item><title>Dmitry commented on NHibernate Mapping - &lt;component/&gt;</title><description>Thanks for the NHibernate topics. As others pointed out, they are really useful.
  
  
Is there a way to map a value object when its primary key is different than the linking field? To illustrate my point better. I have a table Person (ID, Name) and a table Address (ID, PersonID, ...). A person can only have 1 address. I could not make 1-to-1 association work because it expects the ID to be the same.
  
  
  
  
  
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment5</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment5</guid><pubDate>Wed, 08 Apr 2009 18:50:00 GMT</pubDate></item><item><title>Ayende Rahien commented on NHibernate Mapping - &lt;component/&gt;</title><description>pb,
  
Take a look at all-delete-orphans.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment4</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment4</guid><pubDate>Wed, 08 Apr 2009 16:17:25 GMT</pubDate></item><item><title>pb commented on NHibernate Mapping - &lt;component/&gt;</title><description>One thing I've never been able to find an example on is how to have deleted items from an IList be deleted in the DB automatically, similar to how whether or not you add or update an object in an ILIst, calling SaveOrUpdate will do the appropriate thing. I wish there was a SaveOrUpdateOrDelete on the list itself that just peristed the whole list to the DB. 
  
  
What I do to deal with this now is keep the original list and compare it to the saved list and call Delete on any items that are missing. I could react to row changed events on a grid for example but I like to keep from having to do that in every location and just deal with a single list object, make changes to it (which could include binding it to a grid), then persist it.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment3</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment3</guid><pubDate>Wed, 08 Apr 2009 16:09:41 GMT</pubDate></item><item><title>JeroenH commented on NHibernate Mapping - &lt;component/&gt;</title><description>As others have pointed out, really useful series. It's a great way of learning about NHibernate in small, digestable, concise chunks.
  
  
Thanks for the effort in enlightening us, mere mortals :-)
  
  
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment2</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment2</guid><pubDate>Wed, 08 Apr 2009 14:18:05 GMT</pubDate></item><item><title>G commented on NHibernate Mapping - &lt;component/&gt;</title><description>Thanks! Been working with NHibernate for many years and have never used this feature (or even noticed it). It may very well come in handy.
</description><link>http://ayende.com/3937/nhibernate-mapping-component#comment1</link><guid>http://ayende.com/3937/nhibernate-mapping-component#comment1</guid><pubDate>Wed, 08 Apr 2009 14:10:37 GMT</pubDate></item></channel></rss>