I have a class to be mapped as a component that contains several properties, for example, DAY, MONTH and YEAR. The class is decoreated
with [Component()] attribute.
In a master-class I have several properties of this type each decorated
with [ComponentProperty()].
Code:
[Component()]
public class MyComponent
{
[Property()]
public int Days
{get {...};set {...};}
[Property()]
public int Months
{get {...};set {...};}
[Property()]
public int Years
{get {...};set {...};}
}
[Class()]
public class MyPersistentClass
{
[ComponentProperty]
MyComponent OneProp
{get {...};set {...};}
[ComponentProperty]
MyComponent TwoProp
{get {...};set {...};}
[ComponentProperty]
MyComponent ThreeProp
{get {...};set {...};}
}
As a result, all three properties "Days" from "OneProp","TwoProp" and "ThreeProp" are mapped to the same DB column. That is also true for "Years" and "Months".
Unfortunately, I have found no ways to specify different columns in [ComponentProperty()] .