Albert Chow wrote:
>
> Hi,
>
> I'm writing an application using the following architecture :-
>
> applet -> servlet -> session bean -> entity bean
>
> I pass serializable object between applet and servlet, it works fine for
> insertion and retrieval. But I don't know how to indicate the updated
> fields so that servlet and beans know which setter they should use. Can
> anyone help me?? Thanx in advance.
You could modify your serializable object to record changes made on the client.
Add a few methods that can be used by the servlet, e.g.
public class MyClass implements Serializable
{
private String _name;
private boolean _wasNameChanged;
public String getName() { return _name; }
public void setName(String name) { _name = name; _nameWasChanged = true; }
boolean wasNameChanged() { return _wasNameChanged; }
}
You might also want to retain the 'old' values for any changed fields, so that
you can use optimistic updates in the entity bean.
> Albert
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
________________________________________________________________________________
Evan Ireland Sybase EAServer Engineering [EMAIL PROTECTED]
Wellington, New Zealand +64 4 934-5856
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".