Hi all.
Here the following situation:
Code:
[NHibernate.Mapping.Attributes.Class]
public class Appointment : AbstractData, IComparable
{
private ISet<Employee> employees = new SortedSet<Employee>();
[NHibernate.Mapping.Attributes.Set(0, Table = "appointment_employee")]
[NHibernate.Mapping.Attributes.Key(1, Column = "appointment_id")]
[NHibernate.Mapping.Attributes.ManyToMany(2, Column = "employee_id", Class = "VetMedLib.Common.Employee, VetMedLib")]
public virtual ISet<Employee> Employees
{
get { return employees; }
set { employees = value; }
}
Generates following table via NHibernate.Tool.hbm2ddl.SchemaExport:
Code:
create table appointment_employee (
appointment_id int4 not null,
employee_id int4 not null,
primary key (appointment_id, employee_id)
);
I am quite happy with it, but I want to have an extra field in the mapping table ala
Code:
create table appointment_employee (
id int4 not null,
appointment_id int4 not null,
employee_id int4 not null,
primary key id
);
The problem is that the current used db-replication system can not handle pks ala (appointment_id, employee_id).
What are my possible ways to archive this requirement?
Thanks,
ac