Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Relationships for 2 tables

 Post Reply Post Reply
Author
Alex Egorov View Drop Down
Member
Member
Avatar

Joined: 04 May 2017
Posts: 50
Post Options Post Options   Quote Alex Egorov Quote  Post ReplyReply Direct Link To This Post Topic: Relationships for 2 tables
    Posted: 29 Oct 2019 at 1:45pm
Hello,


With Data Modeler was creates such relationships, main idea - user membership and group membership. User can be member of group and group can be member of group. Data Modeler allow this, after generating source code for Aurelius I'm got error for property ChildId - identifier redeclared.

  public
    property MembershipId: Integer read FMembershipId write FMembershipId;
    property ChildId: TUsers read GetChildId write SetChildId;
    property ParentId: TGroups read GetParentId write SetParentId;
    property ChildId: TGroups read GetChildId write SetChildId;
  end;

This is bad construction? How to improve this? Should I create another table for GroupInGroup membership?
Back to Top
Alex Egorov View Drop Down
Member
Member
Avatar

Joined: 04 May 2017
Posts: 50
Post Options Post Options   Quote Alex Egorov Quote  Post ReplyReply Direct Link To This Post Posted: 29 Oct 2019 at 2:05pm
Or will it be easier to store both users and groups in one table?
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2541
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 29 Oct 2019 at 7:53pm
I understand ChildId is a FK for both tables Users and Groups? That's not supported by Aurelius. You should have a FK for User and another for Group.
Back to Top
Alex Egorov View Drop Down
Member
Member
Avatar

Joined: 04 May 2017
Posts: 50
Post Options Post Options   Quote Alex Egorov Quote  Post ReplyReply Direct Link To This Post Posted: 29 Oct 2019 at 7:59pm
Thanks
Back to Top
Alex Egorov View Drop Down
Member
Member
Avatar

Joined: 04 May 2017
Posts: 50
Post Options Post Options   Quote Alex Egorov Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 2019 at 7:30am
Ok, now I have such tables:


And Aurelius mapping result:



How I can improve this to get MembershipChildList and MembershipParentList, using this window I don't understand which list what return for me
Back to Top
Alex Egorov View Drop Down
Member
Member
Avatar

Joined: 04 May 2017
Posts: 50
Post Options Post Options   Quote Alex Egorov Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 2019 at 1:12pm
Found that this is possible to change in General Settings
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2541
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 2019 at 1:26pm
Correct Alex. Or you can simply type the name you want directly in the field "List property name"
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down