Hi all.
I have the Following problem:
I got an entity (let's call it "worker" for the example) which belongs
to another app. From here I want to retrieve some info, and since I
don't want to be always syncronizing, i would like to be fetching info
from here.
I can access it with the following line and all the necessaries
mappings:
Code:
[ActiveRecord("Worker", Schema = "HumanResources.dbo",
SchemaAction = "none", Mutable = false)]
public partial class Worker: ActiveRecordBase
{
[PrimaryKey(PrimaryKeyType.Native, "COD", ColumnType =
"Int32")]
public int Id { get; set; }
[Property("NOME", ColumnType = "String", NotNull = true)]
public virtual string Name { get; set; }
[Property("SEXO", ColumnType = "String", NotNull = true)]
public virtual string Sex { get; set; }
internal static IEnumerable<Worker> FindAll()
{
IEnumerable<Worker> aux = null;
try
{
aux = (IEnumerable<Worker>) ActiveRecordBase.FindAll
(typeof (Worker));
}
catch(Exception _ex)
{
MessageBox.Show(_ex.Message, "Worker Fetch Warning");
}
return aux;
}
}
My developing app is in another schema, so I specify it.
Now I want to be able to make it inherit from a class (call it it
SuperEntity), from which another class (Guest) inherits too.
I would have the following diagram:
SuperEntity
^ ^
| |
Worker Guest
How can I do my mapping? I have been trying several approaches, but
the one I think should be the most correct would be "table per
concrete subclass"... but i am not skilled yet to do it.
Tk
Just one PS: SuperEntity may not be represented in db, although I want
to be able to call all entry's of worker and guest by doing something
like SuperEntity.FindAll().