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
CEO
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

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.