Mapping more than one class to the same table
With NDO you can map different classes to the same table. This way you are able to map a subset of the columns of a table to a class. If you are working with a class that has many fields or has fields with big data chunks you can generate different views to the stored data. You are able to define a base class which gives you sort of a preview that can be displayed in the user interface. With another query the derived class can be obtained.
PictureHeader ph; // mapped to header data
Picture p; // contains the picture data too
....
NDOQuery<Picture> q = new NDOQuery<Picture>(pm, "oid = {0}")
q.parameters.Add(ph.NDOObjectId.Id.Value);
p = (Picture) q.ExecuteSingle();
An alternative would be the FindObject method:
PictureHeader ph; // mapped to header data
Picture p; // contains the picture data too
....
p = (Picture) pm.FindObject(typeof(Picture), ph.NDOObjectId.Id.Value); // Constructs a hollow object