Interface UserDao
-
public interface UserDao
Provides an interface with methods that perform actions on theUser
table of the database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Single<Integer>
delete(User user)
Deletes a single user from the database.Single<Integer>
delete(User... users)
Deletes multiple users from the database.Single<Integer>
delete(Collection<User> users)
Deletes multiple users from the database.Maybe<User>
findByOauthKey(String oauthKey)
Queries the database for a specific user, based on OAuth key.LiveData<User>
findByUserId(long id)
Queries the database for a specific user, based on id.Single<Long>
insert(User user)
Inserts a single user into the database.Single<List<Long>>
insert(User... users)
Inserts multiple users into the database.Single<List<Long>>
insert(Collection<User> users)
Inserts multiple users into the database.Single<Integer>
update(User user)
Updates a single user in the database.Single<Integer>
update(User... users)
Updates multiple users in the database.Single<Integer>
update(Collection<User> users)
Updates multiple users in the database.
-
-
-
Method Detail
-
insert
Single<Long> insert(User user)
Inserts a single user into the database.- Parameters:
user
- The user to be inserted.- Returns:
- A
Single
holding the id of the user that was inserted.
-
insert
Single<List<Long>> insert(User... users)
Inserts multiple users into the database.- Parameters:
users
- The users to be inserted.- Returns:
- A
Single
holding aList
of ids of the the users that were inserted.
-
insert
Single<List<Long>> insert(Collection<User> users)
Inserts multiple users into the database.- Parameters:
users
- The users to be inserted.- Returns:
- A
Single
holding aList
of ids of the the users that were inserted.
-
update
Single<Integer> update(User user)
Updates a single user in the database.- Parameters:
user
- The user to be updated.- Returns:
- A
Single
holding the number of updates performed.
-
update
Single<Integer> update(User... users)
Updates multiple users in the database.- Parameters:
users
- The users to be updated.- Returns:
- A
Single
holding the number of updates performed.
-
update
Single<Integer> update(Collection<User> users)
Updates multiple users in the database.- Parameters:
users
- The users to be updated.- Returns:
- A
Single
holding the number of updates performed.
-
delete
Single<Integer> delete(User user)
Deletes a single user from the database.- Parameters:
user
- The user to be deleted.- Returns:
- A
Single
holding the number of deletions performed.
-
delete
Single<Integer> delete(User... users)
Deletes multiple users from the database.- Parameters:
users
- The users to be deleted.- Returns:
- A
Single
holding the number of deletions performed.
-
delete
Single<Integer> delete(Collection<User> users)
Deletes multiple users from the database.- Parameters:
users
- The users to be deleted.- Returns:
- A
Single
holding the number of deletions performed.
-
findByUserId
LiveData<User> findByUserId(long id)
Queries the database for a specific user, based on id.- Parameters:
id
- The user's id.- Returns:
LiveData
of the selected user.
-
-