BaseORM and save / saveAll

Luis or anyone else.

I have the need to pull back something that I have saved to the database, however when I look at the majority of code, like ContentBox for example.

I see something like this

installerService.saveAll( settings );

When you look at the method saveAll it requires the entity, flush etc. My question is how in the hell are you passing this stuff across with something like the above. I just don’t see it.

I know to solve my question that I am going to need to do a flush so that the data is saved, but how do I pass this across?

For example I am writing some code to hook into the settingsService, it basically creates a new record and I hook into the settingService thinking that the data is automatically available to me, which it isn’t because the session management is not being managed in this case. Now I know I could wrap mine in a transaction block, but what’s the point when this is all part of the VirtualEntityService anyway.

Besides all that I just don’t see how you are passing the entity and anything else to be able to do what I need here? Am I missing something important along the way?

I guess what I am saying is why does saveAll have all these options when they can’t be used?

Hmm can you rephrase your question I did not get it

Luis Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
Social: | |

That’s ok, I figured it out why it wasn’t working.

But when I look at lets say your settingsService, you use bulkSave() which in turn calls saveAll() but neither of these are passing in what is required for the saveAll() that lost me for a bit as to why I couldn’t manually also add the flush to the saveAll() in bulkSave()

But as I solved my issue, its probably more a how did you manage to call saveAll() without passing the required arguments.