morphia icon indicating copy to clipboard operation
morphia copied to clipboard

Missing AlsoLoad Functionality

Open afarra opened this issue 12 years ago • 1 comments
trafficstars

Per the documentation for @AlsoLoad:

When placed on a parameter to a method that takes a single parameter, the method will be called with the data value. As with fields, any ambiguity in the data (multiple properties that would cause the method to be called) will produce an exception. However, @AlsoLoad on a method parameter can be used to override field names and "steal" the value that would otherwise have been set on a field. This can be useful when changing the type of a field.

This however, doesn't seem to be working. Creating a method with a single parameter annotated with AlsoLoad doesn't result in the method being called. This functionality is very useful for 'schema upgrades' and changing the type of the fields.

afarra avatar Aug 26 '13 18:08 afarra

Suggest you post this into (GitHub) mongodb/morphia where 10Gen people will spot it for attention. My fork is hopefully being integrated over time.

On 26 August 2013 19:05, Ahmed Farra [email protected] wrote:

Per the documentation for @AlsoLoad:

When placed on a parameter to a method that takes a single parameter, the method will be called with the data value. As with fields, any ambiguity in the data (multiple properties that would cause the method to be called) will produce an exception. However, @AlsoLoad on a method parameter _can_be used to override field names and "steal" the value that would otherwise have been set on a field. This can be useful when changing the type of a field.

This however, doesn't seem to be working. Creating a method with a single parameter annotated with AlsoLoad doesn't result in the method being called. This functionality is very useful for 'schema upgrades' and changing the type of the fields.

— Reply to this email directly or view it on GitHubhttps://github.com/jmkgreen/morphia/issues/74 .

jmkgreen avatar Aug 27 '13 13:08 jmkgreen