Hello, sorry for may be this stupid question.
I am writing Screen Controller, where some button invokes some method.
In this method I am using getItem(), then change it (like .setSomeValue()) and those changes automatically reflects to database, so it’s ok;
But when I pass this object to ServiceBean, and modify it - nothing happens.
What is correct way to change the Entity form ServiceBean method?
public class OrganizationEdit extends AbstractEditor<Organization> {
@Inject
private QueryOrganizationDatabaseService queryOrganizationDatabaseService;
public void onQueryClick() {
Organization org = getItem();
org.setNameShort("org"); // ok
queryOrganizationDatabaseService.queryOrganization(org); // nothing happens
}
}
@Service(QueryOrganizationDatabaseService.NAME)
public class QueryOrganizationDatabaseServiceBean implements QueryOrganizationDatabaseService {
@Override
public void queryOrganization(Organization org) {
org.setNameShort("org2"); // this call does not change entity
}
}