     (mapping [:CreationTime] :CreationTime)
     (mapping [:Validity] :Validity)
     (mapping [:ProductName] :ProductName)
-    (mapping [:ProductVersion] :ProductVersion)))
-;ASSOC MANAGER: SERVICE   (column "serviceId" :serviceId :notnull)
-;ASSOC MANAGER: MANAGER   (column "managerId" :managerId :notnull)
+    (mapping [:ProductVersion] :ProductVersion))
+  (add-relation [:managerId :Id]); ?????
+  (add-relation :manager_fk_ServiceId))
+;TODO ASSOC MANAGER: MANAGER   (column "managerId" :managerId :notnull) // IS IT NOT RELATION!?
+
+
 
 (foreach [:resource]
   (add-instance :Resource
     (mapping-pk [:Id] :ID)
     (mapping [:Name] :Name)
     (mapping [:CreationTime] :CreationTime)
-    (mapping [:Validity] :Validity)))
-;ASSOC RESOURCE: MANAGER   (column "managerId" :managerId :notnull)
-;ASSOC RESOURCE: SHARE (table "resourceshare" :resourceshare   (column "resourceId" :resourceId :pk :notnull) (column "shareId" :shareId :pk :notnull))
+    (mapping [:Validity] :Validity))
+  (add-relation :resource_fk_ManagerId))
+;TODO ASSOC RESOURCE: SHARE (table "resourceshare" :resourceshare   (column "resourceId" :resourceId :pk :notnull) (column "shareId" :shareId :pk :notnull))
 
 (foreach [:service]
   (add-instance :Service

    (mapping [:StartTime] :StartTime)
    (mapping [:IssuerCA] :IssuerCA)
    (mapping [:DowntimeAnnounce] :DowntimeAnnounce)
    (mapping [:DowntimeInfo] :DowntimeInfo)))
;ASSOC ENDPOINT: SERVICE   (column "serviceId" :serviceId :notnull)

(foreach [:location]
  (add-instance :Location

    (mapping [:Validity] :Validity)
    (mapping [:Type] :Type)
    (mapping [:QualityLevel] :QualityLevel)
    (mapping [:Complexity] :Complexity))
  (add-relation :service_fk_LocationId)
  (add-relation :service_fk_AdminDomainId))
;TODO ASSOC SERVICE: CONTACT   (table "serviceservice" :serviceservice (column "serviceId2" :serviceId2 :pk :notnull) (column "contactId" :contactId :pk :notnull))
;TODO ASSOC SERVICE: SERVICE (table "serviceservice" :serviceservice (column "serviceId2" :serviceId2 :pk :notnull) (column "serviceId1" :serviceId1 :pk :notnull))


(foreach [:share]
  (add-instance :Share
