Master Detail Issue

I have some problems with the Master / Detail.

I have used the example that comes with XData as a reference, however, I am using more resources and I have some questions.

1- When I have a method that is a function that provides me with auto-calculated fields.
2- Why do I require a reference property in the detail? This is causing me problems when creating my database.

I have prepared a small video with a test case, so you can see the problem.

TextCase.zip (220.2 KB)

You specified the new read-only properties Accredited and Certified. Since they are now in JSON, the Web Core client will receive those properties and send back to the server.

You could try to manually remove those properties from the JSON in Web Core app, but I think it's easier if you you just make then writeable in your entity:

    // Campos autocalculados
    [XDataProperty]
    property Accredited: Boolean read GetAccredited write SetAccredited;

    [XDataProperty]
    property Certified: Boolean read GetCertified write SetCertified;

Then in setters just ignore the value.

About the mapping, you should pay attention to bidirectional mapping, as explained here:

In summary do not use ForeignJoinColumn if you have the other side of the association and the field is already declared there with JoinColumn.

Im use te solution
[XDataProperty]
property Accredited: Boolean read GetAccredited write SetAccredited;

and add this decorator
[Transient]
FAccredited: Boolean;

I'm not sure if right ?

Thank you for link to bidirectional mapping, i will check and use in my projects.

It can be like that, but you don't even the FAccredited field. You can simply do nothing in your SetAccredited method.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.