Skip Headers

# Using Java

Previous

Next

You use a `ReturningPolicy` to configure how TopLink handles returning with the attributes of an object on a field-by-field basis. Table: Return Policy Methods describes the `ReturnPolicy` methods you use to tell TopLink how to handle a particular database field. Each method takes a `String` or a `DatabaseField` type parameter as field name.

Return Policy Methods

Method | Applies to SQL Statements of Type... | Writes Current Value of Field to Database? | Returns Database- Generated Result?
--- | --- | --- | ---
`addFieldForInsert` | INSERT | Yes | Yes
`addFieldForInsertReturnOnly` | INSERT | No | Yes
`addFieldForUpdate` | UPDATE | Yes | Yes

You configure a descriptor with a `ReturningPolicy` using `ClassDescriptor` method `setReturningPolicy`.