- This topic has 1 reply, 2 voices, and was last updated 6 years, 6 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Hi,
I have one table and a virtual table that look like this:
[kbmMW_Table(‘name:email’)]
[kbmMW_Root(’email’, [mwrfIncludeOnlyTagged])]
TEmail = class
…
Public
[kbmMW_Field(‘name:email_id, primary:true, generator:sequence’, ftInteger)]
[kbmMW_Element(’email_id’)]
property EmailId: kbmMWNullable<integer> read FEmailId write FEmailId;
Etc.
[kbmMW_VirtualTable(TEmail)]
[kbmMW_Root(’email_outgoing_email’, [mwrfIncludeOnlyTagged])]
TEmailOutgoingEmail = class(TEmail)
Etc.
As far as I understood inserting a TEmailOutgoingEmail with the ORM will actually insert a TEmail. The strange thing is that I get an error that the generator S_TEMAILOUTGOINGEMAIL_EMAIL_ID is not defined. It looks like it tries to use the sequence of the virtual table instead of the non virtual one (the one I expected to be used).
Am I doing something here that I shouldn’t? This construction worked fine in another project were I manually set the primary keys.
Thanks in advance!
Luigi
Hi,
Thank you for your report. You are correct. There is a bug.
To fix, open kbmMWORM.pas, locate TkbmMWORMField.GetSequenceName and make the bolded adjustment. Then it will work as expected.
function TkbmMWORMField.GetSequenceName:string;
begin
Result:=FFieldAttr.Sequence;
if Result=” then
Result:=’s_’+FTable.BaseTable.Name+’_’+FName;
end;