I have a single property that I want stored in two separate mysql columns.
The property is defined as:
public virtual List<Point> Vertices { get; set; }
Point is System.Drawing.Point.
My database table has two columns that i want this one property saved into:
xarr VARCHAR(3000)
yarr VARCHAR(3000)
If Vertices contained the following points:
{1,2}
{3,4}
{5,6}
When the entity was saved by Nhibernate, i would like the
yarr column to be populated with "2,4,6"
xarr column to be populated with "1,3,5"
Please do not advise me on redesigning the database schema. To answer my question I would like to know the best way to achieve this in NHibernate, given the constraints above.
I will admit to not having used NHibernate, but can you just add two properties to the model class for the xarray and yarray strings
and then persist those?
edit:
Alright, if I’m reading this correctly, it sounds like you want to create a VerticesType
Obviously with more error checking. Hope that helps.