How to add getter/setter functions

I’ve created a persistable class with many attributes. I’ve then added a non-persistable attribute (that would be set/get dynamically by the application) and want to create a getter and setter for it. I know how to add them to the class but I cannot figure out how to add the code to the setter and getter. Do you have to create an ORM_implementation class?
Basically, how to I implement the following generated methods:

public Integer getTotal() {
	//TODO: Implement Method
	throw new UnsupportedOperationException();
}

public void setTotal(int double d) {
	//TODO: Implement Method
	throw new UnsupportedOperationException();
}

The ‘total’ is calculated dynamically by the application which needs to setter and getter to set and access this info.

Jean

Hi jvence,

Yes, you need to use the ORM implementation class at this moment. But I think your need is quite common. I will ask our developers to see if anything we can improve to make this operation easier.

Best regards,
Jick

Hi jvence,

I am glad to inform you that in the coming version we will allow you generate getter and setter for non-persistable attribute, by checking Getter and Setter from the attribute specification dialog box.

Best regards,
Jick

hi jvence,

I am glad to inform you that VP Suite 3.0 Service Pack 1 is released. You can generate getter and setter by:

  1. Right-click on an attribute and select Attribute Specification from the popup menu
  2. Check Getter and/or Setter
  3. Confirm changes
  4. Generate code.

Hope this helps. Please feel free to contact me if there are any questions.

Best regards,
Jick