Project

General

Profile

DBO: create record using relationship id instead of providing Dbo::ptr to other record

Added by Gianluca Sorrentino over 2 years ago

Hi,
I need to create some records provided the ID of a relationship defined by belongsTo/ManyToOne.
I wish to avoid to have to load the record first with find() and instead i'd like to specify the ID of the object (likewise a lazy load does).

Is there a way to do that? Dbo::ptr seems to not allow the ID to be provided externally...

Thanks a lot!


Replies (2)

RE: DBO: create record using relationship id instead of providing Dbo::ptr to other record - Added by Gianluca Sorrentino over 2 years ago

Ok, the question was kind of stupid since i kind of answered myself.
lazyLoad does exactly that!

I would say that Wt docs NEED ASAP a full rewrite to expand using more use cases.
The growth of this Framework is highly impacted by the lack of support and poor documentation.

Btw i needed to expand a little Session for my own purposes (really, the DBO needs a lot of common features and support) so i'd suggest to switch to protected from private, until really needed private, and using virtual with the internal functionalities. Not a drama compiling Wt with few modifications of this type but would be nice to not have to change the source at all and use just inheritance and polymorphism.

Btw i believe the potential of this Framework is simply unexpressed, Wt is a great project!
Thanks for it and for keeping it going!

RE: DBO: create record using relationship id instead of providing Dbo::ptr to other record - Added by Rathnadhar K V over 2 years ago

Namaskara,

I have been stating this since long.
Please see my earlier posts.

Yes, Wt needs to build a large community of users....for that the documentation should be comprehensive...but the documents wont get updated till there is a requirement from community...its a catch 22!

    (1-2/2)