A persistent object can be read-only, meaning that it cannot be updated with new attribute values. The following methods let you handle read-only considerations (all are PersistentObject methods):
The read-only status of an object can be checked by calling the isDefaultReadOnly method. If the class was generated from a read-only schema, or the Read Only checkbox is selected in the Mapping Properties notebook, then this method returns true. In this case, update, delete, and add methods will throw exceptions.
If the part is not generated from a read-only view, is DefaultReadOnly returns false. You can update, delete from, or add to the schema table or view by using generated persistent objects.
You can set any given persistent object to be read-only by calling its setReadOnly method and passing in true. Then you cannot change attributes in the object to update the row. You can check the read-only status of an object by calling its isReadOnly method; it will return true if the object is read-only, or false if it is not.
If the default read-only setting is true, then calling setReadOnly with a parameter value of false throws and exception.
![]()
Data Access
Class Library and Generated Code Reference
