Fixed
Status Update
Comments
ya...@google.com <ya...@google.com>
da...@google.com <da...@google.com> #2
hmm room builder cannot take converters because we need them at compile time BUT we can receive a converter factory instead of initializing them ourselves.
Then one can write a type converter producer similar to view models .
https://github.com/googlesamples/android-architecture-components/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/viewmodel/GithubViewModelFactory.kt
Then one can write a type converter producer similar to view models .
ap...@google.com <ap...@google.com> #3
Yes, that would be very much appreciated!
da...@google.com <da...@google.com>
ys...@gmail.com <ys...@gmail.com> #4
Hey guys.
Has any progress been made on this issue? It's really frustrating to not be able to inject my own dependencies into type converter classes.
Has any progress been made on this issue? It's really frustrating to not be able to inject my own dependencies into type converter classes.
nn...@gmail.com <nn...@gmail.com> #5
Unfortunately no :( Any we ahve very resource constraint right now to prioritize it. If you would like to help, i'm happy to help you through the aosp setup.
Description
@Entity
data class User(
@PrimaryKey id: Long,
name: String,
email: String?
)
data class UserName(id: Long, name: String)
data class UserEmail(id: Long, email: String)
@Dao
interface UserDao {
@Insert(entity = User::class)
insertWithoutEmail(userName: UserName)
@Update(entities = User::class)
updateEmail(userEmail: UserEmail)
}
- The @Insert example above is a bit silly, but it makes sense when you want to leave out columns with default values (
- We probably need a better API to support insertion/update of multiple entities/pojos.