It is not possible to inherit from the Table class unless you define a column and key, this is because a table needs to be created. However there is a case for an underlying abstract class such as the one you have demonstrated. If the class was defined as abstract, it should then be considered for persistance, however the reflection engine does not recognise abstract classes at present, we will add this for version 1.1
In the meantime it is perfectly feasible to create your own base class instead of Table. Any class can be persisted, as long as it implements IPersistable. I include the code for the table class which highlights how to do this, which you can use as your own base class or adapt as necessary:
using System;
using Crainiate.Data.Persistence.Providers;
namespace Crainiate.Data.Persistence
{
[Serializable]
public abstract class Table: IPersistable, ITable
{
//Property variables
[NonSerialized] Context _Context;
[NonSerialized] Command _Command;
private Concurrency _Concurrency;
#region Interface
//Constructors
public Table()
{
}
public Table(Context context)
{
Context = context;
}
//Properties
public virtual Context Context
{
get
{
return _Context;
}
set
{
_Context = value;
_Command = null;
_Concurrency = null;
}
}
public virtual Command Command
{
get
{
return _Command;
}
set
{
_Command = value;
}
}
public virtual Concurrency Concurrency
{
get
{
return _Concurrency;
}
set
{
_Concurrency = value;
}
}
//Methods
public virtual void Update()
{
if (Context == null) throw new TableException("The object could not be updated. Set the Context before attempting to update this object.");
if (Command == null) Command = Context.CreateCommand();
Command.Update(this);
}
public virtual void Select()
{
if (Context == null) throw new TableException("The object could not be selected. Set the Context before attempting to select this object.");
if (Command == null) Command = Context.CreateCommand();
if (Concurrency == null) Concurrency = Context.CreateConcurrency();
Command.Select(this);
}
public virtual void Insert()
{
if (Context== null) throw new TableException("The object could not be inserted. Set the Context before attempting to insert for this object.");
if (Command == null) Command = Context.CreateCommand();
Command.Insert(this);
}
public virtual void Delete()
{
if (Context == null) throw new TableException("The object could not be deleted. Set the Context before attempting to delete this object.");
if (Command == null) Command = Context.CreateCommand();
Command.Delete(this);
}
public virtual bool Exists()
{
if (Context == null) throw new TableException("The object could not be checked. Set the Context before attempting to check this object.");
if (Command == null) Command = Context.CreateCommand();
return Command.Exists(this);
}
#endregion
}
}