harish
harish

Reputation: 143

Does Spring Data JPA crudrepository save method have any return value? If so what does it returns?

public void registerCustomer(Customer cust)
{
customerRepo.save(cust);
}

how can i know that my data is insereted successfully in my above code?

Upvotes: 2

Views: 6603

Answers (1)

Lyncean Patel
Lyncean Patel

Reputation: 2721

Here is from CrudReporsitory.save() javadoc:

Saves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.

It seems like save method returns the saved entity instance.

Upvotes: 3

Related Questions