views:

10

answers:

0

Hi,

I am using S#arp Architecture and have a class that maps to a table in the database. This table and class does not have any PrimaryKey or Domainsignature, so I thought it would be a good fit for ValueObject. I know I can map this as a component by using the mapping overrides in Fluent NHibernate to accomplish this. However I am struggling with it, I can't find any method in the mapping override to achieve. Most of the examples on the web shows how to map a component that is associated as a Property to another domain entity. But in my case, there is no domain object at all to which this ValueObject belongs too.

I also thought I should be able to do soemthing like this

AutoPersistenceModel.MapEntitiesFromAssemblyOf<SomeDomainEntity>()
.WithSetup(e => e.IsComponentType = t => t == typeof (SomeValueObject));

or some thing like this

AutoPersistenceModel.MapEntitiesFromAssemblyOf<SomeDomainEntity>()
    .WithSetup(e => e.IsComponentType = t => t.BaseType == typeof (ValueObject)); 

But I don't have the WithSetup() method for AutoPersistenceModel. Its an old project and I am using S#arpArchitecture 1.0 and Fluent Nhibernate 0.1 and NHibernate 2.0.1.4000.

Any idea?

Awaiting, Nabeel

related questions