You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we can make multiple requests to the database and get related objects and code this into Bean subclasses, but one of Limebean's best features is you don't need these subclasses to do work. It might be nice to have an interface which can handled this for us, and allow CRUD operations on joins, without the need for table classes.
Conversely it might be totally overkill to do this as there are ways to achieve it already. But this would provide a common pattern to work with
Or maybe with new objects to create and manage the join tree:
BeanPodpod=api.DispensePod("books")// Single join on Book
pod.Join("authors","author_id","id")// Chained join tree from Book
pod
.Join("publishers","publisher_id","id").Join("publisher_contacts","id","publisher_id").Join("contacts","contact_id","id");// Load an updateBeanbook=pod.Load(7);Beancontact=book.Joins["publishers"].Joins["publisher_contacts"].Joins["contacts"].FirstOrDefault(c =>c.name=="Bob James");if(contact!=null)api.Trash(contact);
(.Joins[...] could lazy load as we need things, instead of eager loading entire trees)
The text was updated successfully, but these errors were encountered:
Nick-Lucas
changed the title
Deal with joins in an OO way
Deal with joins in an OO way without Class Creation
Jul 2, 2016
Right now we can make multiple requests to the database and get related objects and code this into Bean subclasses, but one of Limebean's best features is you don't need these subclasses to do work. It might be nice to have an interface which can handled this for us, and allow CRUD operations on joins, without the need for table classes.
Conversely it might be totally overkill to do this as there are ways to achieve it already. But this would provide a common pattern to work with
A simple interface might look like:
Or maybe with new objects to create and manage the join tree:
(
.Joins[...]
could lazy load as we need things, instead of eager loading entire trees)The text was updated successfully, but these errors were encountered: