Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml	(revision 3941)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml	(revision 3942)
@@ -11,18 +11,27 @@
       <Column Name="Email" Modifier="Override" Type="System.String" CanBeNull="false" />
       <Column Name="Comment" Modifier="Override" Type="System.String" CanBeNull="false" />
+      <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabUserID" Type="HeuristicLabUserRole" />
     </Type>
   </Table>
   <Table Name="" Member="HeuristicLabAbstractRoles">
-    <Type Name="HeuristicLabAbstractRole" Modifier="Abstract">
+    <Type Name="HeuristicLabAbstractRole" IsInheritanceDefault="true" Modifier="Abstract">
       <Column Name="ID" Type="System.Int64" IsReadOnly="true" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
       <Column Name="roleName" Member="RoleName" Storage="_roleName" Type="System.String" CanBeNull="false" />
       <Column Name="parentRoleID" Member="ParentRoleID" Storage="_parentRoleID" Type="System.Int64" CanBeNull="false" />
-      <Column Name="RoleType" Member="IsPermission" Storage="_RoleType" Type="System.Boolean" CanBeNull="false" IsDiscriminator="true" />
-      <Type Name="HeuristicLabRole" InheritanceCode="false" IsInheritanceDefault="true">
-        <Column Name="DummyField1" Type="System.String" CanBeNull="false" />
-      </Type>
-      <Type Name="HeuristicLabPermissionRole" InheritanceCode="true">
-        <Column Name="DummyField2" Type="System.String" CanBeNull="false" />
-      </Type>
+      <Column Member="RoleType" Type="System.String" IsReadOnly="true" CanBeNull="false" UpdateCheck="Always" IsDiscriminator="true" />
+      <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabUserRole" ThisKey="ID" OtherKey="HeuristicLabRoleID" Type="HeuristicLabUserRole" />
+      <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole2" ThisKey="ID" OtherKey="ParentRoleID" Type="HeuristicLabAbstractRole" />
+      <Association Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole" Member="HeuristicLabAbstractRole1" ThisKey="ParentRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" />
+      <Type Name="HeuristicLabPermissionRole" InheritanceCode="permission" />
+      <Type Name="HeuristicLabRole" InheritanceCode="role" />
+    </Type>
+  </Table>
+  <Table Name="" Member="HeuristicLabUserRole">
+    <Type Name="HeuristicLabUserRole">
+      <Column Member="ID" Type="System.Int64" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
+      <Column Member="HeuristicLabUserID" Type="System.Int64" CanBeNull="false" />
+      <Column Member="HeuristicLabRoleID" Type="System.Int64" CanBeNull="false" />
+      <Association Name="HeuristicLabUser_HeuristicLabUserRole" Member="HeuristicLabUser" ThisKey="HeuristicLabUserID" OtherKey="ID" Type="HeuristicLabUser" IsForeignKey="true" />
+      <Association Name="HeuristicLabAbstractRole_HeuristicLabUserRole" Member="HeuristicLabAbstractRole" ThisKey="HeuristicLabRoleID" OtherKey="ID" Type="HeuristicLabAbstractRole" IsForeignKey="true" />
     </Type>
   </Table>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout	(revision 3941)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout	(revision 3942)
@@ -3,29 +3,35 @@
   <DataContextMoniker Name="/DataClassesDataContext" />
   <nestedChildShapes>
-    <classShape Id="8a64982c-bf12-42de-930c-12197e5058b2" absoluteBounds="0.75, 1.125, 2, 2.3478011067708335">
+    <classShape Id="8a64982c-bf12-42de-930c-12197e5058b2" absoluteBounds="0.5, 0.625, 2, 2.3478011067708335">
       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabUser" />
       <nestedChildShapes>
-        <elementListCompartment Id="c2de162f-d029-4b40-9694-ef3f14c7a783" absoluteBounds="0.7649999999999999, 1.585, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="c2de162f-d029-4b40-9694-ef3f14c7a783" absoluteBounds="0.5149999999999999, 1.085, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" absoluteBounds="5.5, 0.75, 2, 1.5785953776041666">
+    <classShape Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" absoluteBounds="3.5, 0.875, 2, 1.5785953776041666">
       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole" />
       <nestedChildShapes>
-        <elementListCompartment Id="c418e826-fe22-4952-802e-047da829e949" absoluteBounds="5.5150000005960464, 1.2100000008940697, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="c418e826-fe22-4952-802e-047da829e949" absoluteBounds="3.5150000005960464, 1.3350000008940697, 1.9700000000000002, 1.0185953776041665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="b49c3eca-7de0-4ace-97ce-90212955db18" absoluteBounds="6.875, 2.75, 2, 1.0016910807291666">
+    <classShape Id="b49c3eca-7de0-4ace-97ce-90212955db18" absoluteBounds="6.875, 0.75, 2, 0.8093896484375">
       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabRole" />
       <nestedChildShapes>
-        <elementListCompartment Id="b2f6a32c-1cff-4bb5-9008-e4e430125a0a" absoluteBounds="6.89, 3.21, 1.9700000000000002, 0.44169108072916663" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="b2f6a32c-1cff-4bb5-9008-e4e430125a0a" absoluteBounds="6.8900000000000006, 1.21, 1.9700000000000002, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <classShape Id="d798095d-2715-4342-bc36-c2e6602a4fba" absoluteBounds="4.125, 2.75, 2, 1.0016910807291666">
+    <classShape Id="d798095d-2715-4342-bc36-c2e6602a4fba" absoluteBounds="6.875, 2, 2, 0.80938964843749961">
       <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabPermissionRole" />
       <nestedChildShapes>
-        <elementListCompartment Id="8328fcdb-eadc-4d44-9aa5-5ae334106ddd" absoluteBounds="4.14, 3.21, 1.9700000000000002, 0.44169108072916663" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="8328fcdb-eadc-4d44-9aa5-5ae334106ddd" absoluteBounds="6.89, 2.46, 1.9700000000000002, 0.2493896484375" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
-    <inheritanceConnector edgePoints="[(6.5 : 2.32859537760417); (6.5 : 2.5); (7.875 : 2.5); (7.875 : 2.75)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+    <inheritanceConnector edgePoints="[(5.5 : 2.22679768880208); (6.875 : 2.22679768880208)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+      <nodes>
+        <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
+        <classShapeMoniker Id="d798095d-2715-4342-bc36-c2e6602a4fba" />
+      </nodes>
+    </inheritanceConnector>
+    <inheritanceConnector edgePoints="[(5.5 : 1.21719482421875); (6.875 : 1.21719482421875)]" fixedFrom="Algorithm" fixedTo="Algorithm" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
       <nodes>
         <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
@@ -33,10 +39,31 @@
       </nodes>
     </inheritanceConnector>
-    <inheritanceConnector edgePoints="[(6.5 : 2.32859537760417); (6.5 : 2.5); (5.125 : 2.5); (5.125 : 2.75)]" fixedFrom="NotFixed" fixedTo="NotFixed" TargetRelationshipDomainClassId="7a7fe09e-e9ef-4b01-9ff3-bde95e827b62">
+    <classShape Id="032f81a1-f00c-4b0f-b4fc-8cf872ad58a6" absoluteBounds="0.625, 3.625, 2, 1.3862939453124996">
+      <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabUserRole" />
+      <nestedChildShapes>
+        <elementListCompartment Id="b6e006b6-2555-4d02-852a-c5bae38cd56c" absoluteBounds="0.6399999999999999, 4.085, 1.9700000000000002, 0.8262939453125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+      </nestedChildShapes>
+    </classShape>
+    <associationConnector edgePoints="[(1.5625 : 2.97280110677083); (1.5625 : 3.625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabUser/HeuristicLabUser_HeuristicLabUserRole" />
+      <nodes>
+        <classShapeMoniker Id="8a64982c-bf12-42de-930c-12197e5058b2" />
+        <classShapeMoniker Id="032f81a1-f00c-4b0f-b4fc-8cf872ad58a6" />
+      </nodes>
+    </associationConnector>
+    <associationConnector edgePoints="[(3.9687475 : 2.45359537760417); (3.9687475 : 4.35564697265625); (2.625 : 4.35564697265625)]" fixedFrom="Algorithm" fixedTo="Algorithm">
+      <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole/HeuristicLabAbstractRole_HeuristicLabUserRole" />
       <nodes>
         <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
-        <classShapeMoniker Id="d798095d-2715-4342-bc36-c2e6602a4fba" />
+        <classShapeMoniker Id="032f81a1-f00c-4b0f-b4fc-8cf872ad58a6" />
       </nodes>
-    </inheritanceConnector>
+    </associationConnector>
+    <associationConnector edgePoints="[(4.20242346379207 : 0.875); (4.20242346379207 : 0.625); (4.81174684745593 : 0.625); (4.81174684745593 : 0.875)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+      <AssociationMoniker Name="/DataClassesDataContext/HeuristicLabAbstractRole/HeuristicLabAbstractRole_HeuristicLabAbstractRole" />
+      <nodes>
+        <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
+        <classShapeMoniker Id="c7373ccc-61b3-43fb-88fa-14149d69bee9" />
+      </nodes>
+    </associationConnector>
   </nestedChildShapes>
 </ordesignerObjectsDiagram>
Index: /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs
===================================================================
--- /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs	(revision 3941)
+++ /branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.designer.cs	(revision 3942)
@@ -2,9 +2,9 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.4927
+//     Dieser Code wurde von einem Tool generiert.
+//     Laufzeitversion:2.0.50727.4927
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
+//     der Code erneut generiert wird.
 // </auto-generated>
 //------------------------------------------------------------------------------
@@ -36,4 +36,7 @@
     partial void UpdateHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
     partial void DeleteHeuristicLabAbstractRole(HeuristicLabAbstractRole instance);
+    partial void InsertHeuristicLabUserRole(HeuristicLabUserRole instance);
+    partial void UpdateHeuristicLabUserRole(HeuristicLabUserRole instance);
+    partial void DeleteHeuristicLabUserRole(HeuristicLabUserRole instance);
     #endregion
 		
@@ -75,4 +78,12 @@
 			{
 				return this.GetTable<HeuristicLabAbstractRole>();
+			}
+		}
+		
+		public System.Data.Linq.Table<HeuristicLabUserRole> HeuristicLabUserRole
+		{
+			get
+			{
+				return this.GetTable<HeuristicLabUserRole>();
 			}
 		}
@@ -100,4 +111,6 @@
 		
 		private string _Comment;
+		
+		private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
 		
     #region Extensibility Method Definitions
@@ -117,4 +130,5 @@
 		public HeuristicLabUser()
 		{
+			this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
 			OnCreated();
 		}
@@ -236,4 +250,17 @@
 		}
 		
+		[Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabUserID")]
+		public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
+		{
+			get
+			{
+				return this._HeuristicLabUserRole;
+			}
+			set
+			{
+				this._HeuristicLabUserRole.Assign(value);
+			}
+		}
+		
 		public event PropertyChangingEventHandler PropertyChanging;
 		
@@ -254,10 +281,22 @@
 				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 			}
+		}
+		
+		private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabUser = this;
+		}
+		
+		private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabUser = null;
 		}
 	}
 	
 	[Table(Name="")]
-	[InheritanceMapping(Code="false", Type=typeof(HeuristicLabRole), IsDefault=true)]
-	[InheritanceMapping(Code="true", Type=typeof(HeuristicLabPermissionRole))]
+	[InheritanceMapping(Code="permission", Type=typeof(HeuristicLabPermissionRole))]
+	[InheritanceMapping(Code="role", Type=typeof(HeuristicLabRole))]
 	public abstract partial class HeuristicLabAbstractRole : INotifyPropertyChanging, INotifyPropertyChanged
 	{
@@ -271,5 +310,11 @@
 		private long _parentRoleID;
 		
-		private bool _RoleType;
+		private string _RoleType = default(string);
+		
+		private EntitySet<HeuristicLabUserRole> _HeuristicLabUserRole;
+		
+		private EntitySet<HeuristicLabAbstractRole> _HeuristicLabAbstractRole2;
+		
+		private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole1;
 		
     #region Extensibility Method Definitions
@@ -281,10 +326,11 @@
     partial void OnParentRoleIDChanging(long value);
     partial void OnParentRoleIDChanged();
-    partial void OnIsPermissionChanging(bool value);
-    partial void OnIsPermissionChanged();
     #endregion
 		
 		public HeuristicLabAbstractRole()
 		{
+			this._HeuristicLabUserRole = new EntitySet<HeuristicLabUserRole>(new Action<HeuristicLabUserRole>(this.attach_HeuristicLabUserRole), new Action<HeuristicLabUserRole>(this.detach_HeuristicLabUserRole));
+			this._HeuristicLabAbstractRole2 = new EntitySet<HeuristicLabAbstractRole>(new Action<HeuristicLabAbstractRole>(this.attach_HeuristicLabAbstractRole2), new Action<HeuristicLabAbstractRole>(this.detach_HeuristicLabAbstractRole2));
+			this._HeuristicLabAbstractRole1 = default(EntityRef<HeuristicLabAbstractRole>);
 			OnCreated();
 		}
@@ -339,6 +385,6 @@
 		}
 		
-		[Column(Name="RoleType", Storage="_RoleType", IsDiscriminator=true)]
-		public bool IsPermission
+		[Column(Storage="_RoleType", CanBeNull=false, UpdateCheck=UpdateCheck.Never, IsDiscriminator=true)]
+		public string RoleType
 		{
 			get
@@ -346,13 +392,62 @@
 				return this._RoleType;
 			}
-			set
-			{
-				if ((this._RoleType != value))
-				{
-					this.OnIsPermissionChanging(value);
-					this.SendPropertyChanging();
-					this._RoleType = value;
-					this.SendPropertyChanged("IsPermission");
-					this.OnIsPermissionChanged();
+		}
+		
+		[Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabUserRole", ThisKey="ID", OtherKey="HeuristicLabRoleID")]
+		public EntitySet<HeuristicLabUserRole> HeuristicLabUserRole
+		{
+			get
+			{
+				return this._HeuristicLabUserRole;
+			}
+			set
+			{
+				this._HeuristicLabUserRole.Assign(value);
+			}
+		}
+		
+		[Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole2", ThisKey="ID", OtherKey="ParentRoleID")]
+		public EntitySet<HeuristicLabAbstractRole> HeuristicLabAbstractRole2
+		{
+			get
+			{
+				return this._HeuristicLabAbstractRole2;
+			}
+			set
+			{
+				this._HeuristicLabAbstractRole2.Assign(value);
+			}
+		}
+		
+		[Association(Name="HeuristicLabAbstractRole_HeuristicLabAbstractRole", Storage="_HeuristicLabAbstractRole1", ThisKey="ParentRoleID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabAbstractRole HeuristicLabAbstractRole1
+		{
+			get
+			{
+				return this._HeuristicLabAbstractRole1.Entity;
+			}
+			set
+			{
+				HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole1.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabAbstractRole1.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabAbstractRole1.Entity = null;
+						previousValue.HeuristicLabAbstractRole2.Remove(this);
+					}
+					this._HeuristicLabAbstractRole1.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabAbstractRole2.Add(this);
+						this._parentRoleID = value.ID;
+					}
+					else
+					{
+						this._parentRoleID = default(long);
+					}
+					this.SendPropertyChanged("HeuristicLabAbstractRole1");
 				}
 			}
@@ -377,4 +472,43 @@
 				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 			}
+		}
+		
+		private void attach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabAbstractRole = this;
+		}
+		
+		private void detach_HeuristicLabUserRole(HeuristicLabUserRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabAbstractRole = null;
+		}
+		
+		private void attach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabAbstractRole1 = this;
+		}
+		
+		private void detach_HeuristicLabAbstractRole2(HeuristicLabAbstractRole entity)
+		{
+			this.SendPropertyChanging();
+			entity.HeuristicLabAbstractRole1 = null;
+		}
+	}
+	
+	public partial class HeuristicLabPermissionRole : HeuristicLabAbstractRole
+	{
+		
+    #region Extensibility Method Definitions
+    partial void OnLoaded();
+    partial void OnValidate(System.Data.Linq.ChangeAction action);
+    partial void OnCreated();
+    #endregion
+		
+		public HeuristicLabPermissionRole()
+		{
+			OnCreated();
 		}
 	}
@@ -383,12 +517,8 @@
 	{
 		
-		private string _DummyField1;
-		
     #region Extensibility Method Definitions
     partial void OnLoaded();
     partial void OnValidate(System.Data.Linq.ChangeAction action);
     partial void OnCreated();
-    partial void OnDummyField1Changing(string value);
-    partial void OnDummyField1Changed();
     #endregion
 		
@@ -396,31 +526,22 @@
 		{
 			OnCreated();
-		}
-		
-		[Column(Storage="_DummyField1", CanBeNull=false)]
-		public string DummyField1
-		{
-			get
-			{
-				return this._DummyField1;
-			}
-			set
-			{
-				if ((this._DummyField1 != value))
-				{
-					this.OnDummyField1Changing(value);
-					this.SendPropertyChanging();
-					this._DummyField1 = value;
-					this.SendPropertyChanged("DummyField1");
-					this.OnDummyField1Changed();
-				}
-			}
 		}
 	}
 	
-	public partial class HeuristicLabPermissionRole : HeuristicLabAbstractRole
+	[Table(Name="")]
+	public partial class HeuristicLabUserRole : INotifyPropertyChanging, INotifyPropertyChanged
 	{
 		
-		private string _DummyField2;
+		private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
+		
+		private long _ID;
+		
+		private long _HeuristicLabUserID;
+		
+		private long _HeuristicLabRoleID;
+		
+		private EntityRef<HeuristicLabUser> _HeuristicLabUser;
+		
+		private EntityRef<HeuristicLabAbstractRole> _HeuristicLabAbstractRole;
 		
     #region Extensibility Method Definitions
@@ -428,30 +549,172 @@
     partial void OnValidate(System.Data.Linq.ChangeAction action);
     partial void OnCreated();
-    partial void OnDummyField2Changing(string value);
-    partial void OnDummyField2Changed();
+    partial void OnIDChanging(long value);
+    partial void OnIDChanged();
+    partial void OnHeuristicLabUserIDChanging(long value);
+    partial void OnHeuristicLabUserIDChanged();
+    partial void OnHeuristicLabRoleIDChanging(long value);
+    partial void OnHeuristicLabRoleIDChanged();
     #endregion
 		
-		public HeuristicLabPermissionRole()
-		{
-			OnCreated();
-		}
-		
-		[Column(Storage="_DummyField2", CanBeNull=false)]
-		public string DummyField2
-		{
-			get
-			{
-				return this._DummyField2;
-			}
-			set
-			{
-				if ((this._DummyField2 != value))
-				{
-					this.OnDummyField2Changing(value);
-					this.SendPropertyChanging();
-					this._DummyField2 = value;
-					this.SendPropertyChanged("DummyField2");
-					this.OnDummyField2Changed();
-				}
+		public HeuristicLabUserRole()
+		{
+			this._HeuristicLabUser = default(EntityRef<HeuristicLabUser>);
+			this._HeuristicLabAbstractRole = default(EntityRef<HeuristicLabAbstractRole>);
+			OnCreated();
+		}
+		
+		[Column(Storage="_ID", AutoSync=AutoSync.OnInsert, IsPrimaryKey=true, IsDbGenerated=true)]
+		public long ID
+		{
+			get
+			{
+				return this._ID;
+			}
+			set
+			{
+				if ((this._ID != value))
+				{
+					this.OnIDChanging(value);
+					this.SendPropertyChanging();
+					this._ID = value;
+					this.SendPropertyChanged("ID");
+					this.OnIDChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_HeuristicLabUserID")]
+		public long HeuristicLabUserID
+		{
+			get
+			{
+				return this._HeuristicLabUserID;
+			}
+			set
+			{
+				if ((this._HeuristicLabUserID != value))
+				{
+					if (this._HeuristicLabUser.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHeuristicLabUserIDChanging(value);
+					this.SendPropertyChanging();
+					this._HeuristicLabUserID = value;
+					this.SendPropertyChanged("HeuristicLabUserID");
+					this.OnHeuristicLabUserIDChanged();
+				}
+			}
+		}
+		
+		[Column(Storage="_HeuristicLabRoleID")]
+		public long HeuristicLabRoleID
+		{
+			get
+			{
+				return this._HeuristicLabRoleID;
+			}
+			set
+			{
+				if ((this._HeuristicLabRoleID != value))
+				{
+					if (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue)
+					{
+						throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
+					}
+					this.OnHeuristicLabRoleIDChanging(value);
+					this.SendPropertyChanging();
+					this._HeuristicLabRoleID = value;
+					this.SendPropertyChanged("HeuristicLabRoleID");
+					this.OnHeuristicLabRoleIDChanged();
+				}
+			}
+		}
+		
+		[Association(Name="HeuristicLabUser_HeuristicLabUserRole", Storage="_HeuristicLabUser", ThisKey="HeuristicLabUserID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabUser HeuristicLabUser
+		{
+			get
+			{
+				return this._HeuristicLabUser.Entity;
+			}
+			set
+			{
+				HeuristicLabUser previousValue = this._HeuristicLabUser.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabUser.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabUser.Entity = null;
+						previousValue.HeuristicLabUserRole.Remove(this);
+					}
+					this._HeuristicLabUser.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabUserRole.Add(this);
+						this._HeuristicLabUserID = value.ID;
+					}
+					else
+					{
+						this._HeuristicLabUserID = default(long);
+					}
+					this.SendPropertyChanged("HeuristicLabUser");
+				}
+			}
+		}
+		
+		[Association(Name="HeuristicLabAbstractRole_HeuristicLabUserRole", Storage="_HeuristicLabAbstractRole", ThisKey="HeuristicLabRoleID", OtherKey="ID", IsForeignKey=true)]
+		public HeuristicLabAbstractRole HeuristicLabAbstractRole
+		{
+			get
+			{
+				return this._HeuristicLabAbstractRole.Entity;
+			}
+			set
+			{
+				HeuristicLabAbstractRole previousValue = this._HeuristicLabAbstractRole.Entity;
+				if (((previousValue != value) 
+							|| (this._HeuristicLabAbstractRole.HasLoadedOrAssignedValue == false)))
+				{
+					this.SendPropertyChanging();
+					if ((previousValue != null))
+					{
+						this._HeuristicLabAbstractRole.Entity = null;
+						previousValue.HeuristicLabUserRole.Remove(this);
+					}
+					this._HeuristicLabAbstractRole.Entity = value;
+					if ((value != null))
+					{
+						value.HeuristicLabUserRole.Add(this);
+						this._HeuristicLabRoleID = value.ID;
+					}
+					else
+					{
+						this._HeuristicLabRoleID = default(long);
+					}
+					this.SendPropertyChanged("HeuristicLabAbstractRole");
+				}
+			}
+		}
+		
+		public event PropertyChangingEventHandler PropertyChanging;
+		
+		public event PropertyChangedEventHandler PropertyChanged;
+		
+		protected virtual void SendPropertyChanging()
+		{
+			if ((this.PropertyChanging != null))
+			{
+				this.PropertyChanging(this, emptyChangingEventArgs);
+			}
+		}
+		
+		protected virtual void SendPropertyChanged(String propertyName)
+		{
+			if ((this.PropertyChanged != null))
+			{
+				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
 			}
 		}
