Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sinyu890807 committed Jan 13, 2016
1 parent 673e3ae commit 2fd30ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ song2.save();
This will insert album, song1 and song2 into database with relations.

#### 4. Update data
The simplest way, use **save()** method to update a record found by **find()**:
``` java
Album albumToUpdate = DataSupport.find(Album.class, 1);
albumToUpdate.setPrice(20.99f); // raise the price
albumToUpdate.save();
```java
Each model which inherits from **DataSupport** would also have **update()** and **updateAll()** method. You can update a single record with a specified id:
``` java
Album albumToUpdate = new Album();
Expand Down

0 comments on commit 2fd30ab

Please sign in to comment.