Standard Naming Convention for DAO Methods

dao, design-patterns, java, naming-conventions

Solution

Usually I name the methods in such way that the name hints the type of the CRUD operation that will be applied by the method, like `add*`, `save*` or `find*`.

`add*` can be applied on `INSERT` operations, like `addPhoneNumber(Long userId)`.

`get*` can be applied for `SELECT` operations, like `getEmailAddress(Long userId)`.

`set*` can be applied on method that performs an `UPDATE` operation.

`delete*` can be applied on `DELETE` operations, like `deleteUser(Long userId)`. Althought I'm not pretty sure how useful is the physical delete. Personally, I would set a flag that denotes that the row is not gonna be used, rather than performing a physical delete.

`is*` can be applied on a method that check something, for example `isUsernameAvailable(String username)`.

Problem

Is there a standard naming convention for DAO methods, similar to JavaBeans? For example, one naming convention I've seen is to use `get()` to return a single entity and `find()` to return a List of entities. If there isn't one, what's the one your team is using and why?

Original source