NHibernate.Mapping.Attributes icon indicating copy to clipboard operation
NHibernate.Mapping.Attributes copied to clipboard

NHMA-35 - Automatic "access" attribute calculation

Open Toshik opened this issue 9 years ago • 6 comments

Usually you should specify "access" attribute. There are mapping errors when someone refactors code and converts field to/from property and forgets to change attribute value.

There is some automatisation:

  1. If you specify "access" explicit - it will be used
  2. If "access" is not specified - NHMA will determine if it is "field" or "property"

It works for all attribute types except ComponentAttribute, there you should specify "access" manually.

Toshik avatar Apr 14 '15 12:04 Toshik

I am not too familiar with pull requests. Last commit 7f560ea should not be in that request :)

Toshik avatar Apr 14 '15 13:04 Toshik

@Toshik: was there a JIRA issue for this?

rjperes avatar Apr 14 '15 13:04 rjperes

@rjperes Nope, I just use it in production for a long time, now wanted to share

Toshik avatar Apr 14 '15 13:04 Toshik

There was hell, when we refactored our model from field mapping to property/field mixed mapping. We always forget to change attribute value from/to "property"/"field", so I have made this improvement.

Toshik avatar Apr 14 '15 13:04 Toshik

OK, but you should create JIRA issues, just to keep track of changes... otherwise, it's difficult to know why things changed.

rjperes avatar Apr 14 '15 13:04 rjperes

Ok, here it is: https://nhibernate.jira.com/browse/NHMA-35

Toshik avatar Apr 14 '15 13:04 Toshik