Hi,
I have a Data source defined as follows
I'd like to add business logic so I added
In the class I'd like to set values before inserting and also read values after the object has been managed so I declared the method:
My asumptions are somehow wrong. I requested the JPA2Entity as a method parameter and I received it but all changes I made on it are ignored when executing dsRequest.execute();
Do I need to set everything as attributes? What about related objects?
dsRequest.getCriteria().put("job", jpa2EntityJob);
best regards,
Zdary
I have a Data source defined as follows
Code:
<DataSource ID="usersDS" serverConstructor="com.isomorphic.jpa.JPA2DataSource" beanClassName="cz.bcom.smartrise.server.persistence.hibernate.UsrUsers" dropExtraFields="true">
Code:
<serverObject lookupStyle="new" className="cz.bcom.smartrise.server.persistence.dmi.UsersDMI"/>
Code:
public DSResponse add(JPA2Entity record, DSRequest dsRequest) throws Exception { record.setActive(true); // this is ignored dsRequest.getCriteria().put("active", true); //this works DSResponse dsResponse = dsRequest.execute(); JPA2Entity alreadyManagedEntity= (JPA2Entity)dsResponse.getData(); System.out.println(alreadyManagedEntity.getId()); }
Do I need to set everything as attributes? What about related objects?
dsRequest.getCriteria().put("job", jpa2EntityJob);
best regards,
Zdary
Comment