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 onINSERT
operations, likeaddPhoneNumber(Long userId)
.get*
can be applied forSELECT
operations, likegetEmailAddress(Long userId)
.set*
can be applied on method that performs anUPDATE
operation.delete*
can be applied onDELETE
operations, likedeleteUser(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 exampleisUsernameAvailable(String username)
.