Hi All,
I am using hbm2java to generate POJOs from a hibernate mapping. It all looks good except for the lines that fire property events. I get two problems:
The code ...
public void setName(String name) throws PropertyVetoException {
Object oldValue = this.name;
vetos.fireVetoableChange("name",
oldValue,
name);
this.name = name;
changes.firePropertyChange("name",
oldValue,
name);
}
... does not compile as the member "vetos" is not declared. A similar problem occurs for change events where "changes" is not declared.
Additionally, there does not seem to be an import line generated for the classes "PropertyChangeListener" and "PropertyVetoException". So they come up as unresolved.
What am I missing? Does your POJO class need to inherit from a specific base class when using this functionality? Does the import line need adding manually? Both these options are potential solutions, but I'd like to think there is a better solution before I do this ...
Thanks in advance
Ian
|