What Event should an @EventListener method listen to in order to execute right after all of Spring context has been initialized?
@EventListener
public void saveOneObject(SomeEventClass event) {
ao.executeInTransaction(new TransactionCallback<MyObject>()
{
@Override
public MyObject doInTransaction() {
MyObject myObject = ao.create(MyObject.class);
myObject.setAttr1();
myObject.setAttr2();
//...
myObject.save();
return myObject;
}
});
}
Not really part of the question, but for some context, I’m trying to initialize ActiveObjects db with some default values. Apparently, this can’t be done until all of Spring context has been initialized. [AO-530] - Ecosystem Jira