From: Graeme Defty <graeme.de...@gmail.com>
Date: Mon, 16 May 2011 10:22:41 +0700
Local: Sun, May 15 2011 11:22 pm
Subject: Re: Saving relationships
Looks good to me. g > Hi Andre,
> On Thu, May 12, 2011 at 1:52 PM, Andre Nathan <an...@digirati.com.br> > > Say I have a model with multiple has_many relationships. For example, > > -module(bookstore, [Id, Name]). > > Now say that when I create a new bookstore, the employes and books are > > I'm doing something like this: > > - Create a new bookstore > > The code for this can become somewhat complicated as more relationships > > So, is there a better way do this? It would be cool if there was a way > > B1 = bookstore:new(id, "foo"), > > Is it possible to add something like this to the API? > The trouble with this approach is that the Bookstore object is really > However, your problem might be better solved with database > ok = boss_db:transaction(fun() -> > lists:map(fun(Employee) -> > lists:map(fun(Book) -> > Any run-time error would result in the transaction being rolled back. > Not all databases support transactions but we could probably use the > > Thanks, > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||