-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if the field is writeable when mapping value to param #735
Conversation
Please, check your changes with the updated repo version. |
@danieleteti |
@danieleteti in the version 3.4.2-magnesium, the enumarator value foWriteOnly is missing. What is happening? What is the new solution? |
Yes, has been removed to improve the whole mechanism. Also, the activerecord_showcase sample has been updated to show how to use such "FieldOptions". Here's an extract of the new attributes. [MVCTable('customers')]
TCustomerWithOptions = class(TCustomEntity)
private
[MVCTableField('id', [foPrimaryKey, foAutoGenerated])]
fID: Integer;
[MVCTableField('code', [foDoNotInsert, foDoNotUpdate])]
fCode: NullableString;
[MVCTableField('description', [foDoNotInsert])]
fCompanyName: string;
[MVCTableField('city', [foDoNotUpdate])]
fCity: string;
public
property ID: Integer read fID write fID;
property Code: NullableString read fCode write fCode;
property CompanyName: string read fCompanyName write fCompanyName;
property City: string read fCity write fCity;
end; |
@danieleteti I analyzed the change history of the MVCFramework.ActiveRecord unit and noticed that the foWriteOnly enumerated value was changed to foDoNotSelect. For those who had the problem, search for "foWriteOnly" and don't find anything about it. I suggest you change the post you sent me and the readme to contain this more detailed information. foWriteOnly = Only allows writing, so it must be accepted in Insert and Update. So it makes sense to be replaced by foDoNotSelect which does not allow reading. Is it correct? |
Yes, good point. I'll do the change ASAP.
Thank you
DT
Il giorno mar 21 mag 2024 alle ore 23:50 Marcelo Jaloto <
***@***.***> ha scritto:
… @danieleteti <https://github.com/danieleteti> I analyzed the change
history of the MVCFramework.ActiveRecord unit and noticed that the
foWriteOnly enumerated value was changed to foDoNotSelect. For those who
had the problem, search for "foWriteOnly" and don't find anything about it.
I suggest you change the post you sent me and the readme to contain this
more detailed information.
foWriteOnly = Only allows writing, so it must be accepted in Insert and
Update. So it makes sense to be replaced by foDoNotSelect which does not
allow reading.
Is it correct?
—
Reply to this email directly, view it on GitHub
<#735 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4ZJGUVREXIC3UEIXE63LZDO6RZAVCNFSM6AAAAABENH23DCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGQ4TONZTGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
*DANIELE TETI*
CEO & CTO @ bit Time Professionals
Web site: www.bittimeprofessionals.it, www.bittimeprofessionals.com
Blog: www.danieleteti.it
My latest book on leanpub <https://leanpub.com/delphimvcframework>
My previous books on amazon
<https://www.amazon.it/s?i=stripbooks&rh=p_27%3ADaniele+Teti>
Mobile: +39 3496626822
Office: +39 06 20761499
|
@danieleteti Thanks! |
Found a small problem when you map the same table field to more than 1 variable, like this:
I map the same field
password
to 2 different variables. TheFPassword
is read-only and theFNewPassword
is write-only.In this case the
TMVCActiveRecord.ExecNonQuery
method must discard the read-only mapping, if not the value will be replaced in other loop iteractions.