This question is locked. New answers and comments are not allowed.
I want to set up a managed collection using a property that is overridden in a derived class, but the Forward Mapping dialog doesn't provide that option.
My application is for an industrial control system that uses many types of devices, such as sensor and push buttons. A sensor can be located anywhere in the factory, but a push button must be located on a control panel. Other devices, including sensors, can also be located in a control panel.
To implement this, I have a Device class with a Location property, and Sensor and PushButton classes are derived from it. In the Push Button class the Location property is overridden so that it can only be set to a Panel object. The Panel class contains a collection of PushButtons, plus a separate collection of Devices.
In the Forward Mapping dialog, if I set the Mapping Relationship for the Panel _pushButtons field to 1:n, the Inverse Field is {auto} but the Manage Collection option is not available. Below that, the DB Column Name appears as id2, and in the database an id2 column is added to the PushButton table, even though it doesn't appear in App.config.
When I build the project, I get a warning "Generation of duplicate column name attempted for reference field 'Panel__pushButtons' of class 'Integrator.System.PushButton'". Maybe this is because it's getting confused between Panel's PushButtons and Devices collections?
My application is for an industrial control system that uses many types of devices, such as sensor and push buttons. A sensor can be located anywhere in the factory, but a push button must be located on a control panel. Other devices, including sensors, can also be located in a control panel.
To implement this, I have a Device class with a Location property, and Sensor and PushButton classes are derived from it. In the Push Button class the Location property is overridden so that it can only be set to a Panel object. The Panel class contains a collection of PushButtons, plus a separate collection of Devices.
In the Forward Mapping dialog, if I set the Mapping Relationship for the Panel _pushButtons field to 1:n, the Inverse Field is {auto} but the Manage Collection option is not available. Below that, the DB Column Name appears as id2, and in the database an id2 column is added to the PushButton table, even though it doesn't appear in App.config.
When I build the project, I get a warning "Generation of duplicate column name attempted for reference field 'Panel__pushButtons' of class 'Integrator.System.PushButton'". Maybe this is because it's getting confused between Panel's PushButtons and Devices collections?