Why can't I install ReadOnly on Fluent NHibernate References () mapping?

In Fluent NHibernate, Reference () returns an object that does not support the ReadOnly () method.

I am trying to create such a mapping (for example, one where the update does not apply to the specified element):

<many-to-one update="false" insert="false" name="DestinationSheet" column="DestinationSheetNumber" /> 

In normal (map ()) mappings, these two attributes can be set using ReadOnly ().

I would like to do something like this:

 References(x => x.DestinationSheet). ColumnName("DestinationSheetNumber").ReadOnly(); 

I can manually add an update and insert attributes using SetAttributes (), and this works fine, but I am worried that the fact that ReadOnly () is not in the links () is the key that I should not try to do this.

Does anyone know why ReadOnly () is not available in this context?

+4
source share
3 answers

It just hasn't been implemented yet. Over time, we will begin to support all NHibernate functions, but until then there is a SetAttribute method so you can continue.

Aside, we accept patches!

+5
source

Links create a multi-valued mapping and , according to the documentation , only reading is not supported with this mapping. Your approach to setting updates and inserting into false sounds for me. AFAIK, the Fluent NHibernate project plans to support all NHibernate display functions, but before that you will have to use SetAttributes.

0
source

Fulfilling the answer provided by James Gregory,

 References(x => x.Store).TheColumnNameIs("StoreId").SetAttribute("update","false"); 
0
source

All Articles