Fixed
Status Update
Comments
m6...@mschmitt.info <m6...@mschmitt.info> #2
My work-around has been using a replacement base class for `BaseObservable`:
```
public class ObservableEntity implements Observable {
@Ignore private transient PropertyChangeRegistry propertyChangeRegistry;
...
}
```
Imho there should be a setting (either on the database builder or on the `@Entity` annotation) to disable mapping for super classes altogether. I was rather surprised Room included the super class. What do I do if I'm not in control of the super class? `BaseObservable` marking its field as `transient` seems like a rare exception to me.
```
public class ObservableEntity implements Observable {
@Ignore private transient PropertyChangeRegistry propertyChangeRegistry;
...
}
```
Imho there should be a setting (either on the database builder or on the `@Entity` annotation) to disable mapping for super classes altogether. I was rather surprised Room included the super class. What do I do if I'm not in control of the super class? `BaseObservable` marking its field as `transient` seems like a rare exception to me.
yb...@google.com <yb...@google.com> #3
I think we can fix this by adding an attribute into the annotation to ignore super fields. Would that work for you?
to...@gmail.com <to...@gmail.com> #4
Personally, yes, because subclassing ORM objects has only ever brought me pain.
yb...@google.com <yb...@google.com>
yb...@google.com <yb...@google.com> #5
i think i'm leaning towards ignoring transient fields automatically.
seems like a more reasonable default.
seems like a more reasonable default.
yb...@google.com <yb...@google.com> #6
in the next version, we will ignore transient fields UNLESS they are annotated with ColumnInfo, Embedded or Relation.
Description
Version used: 1.0.0-alpha2
Devices/Android versions reproduced on: N/A
If my entities subclass BaseObservable then they gain an `mCallbacks` field of type `PropertyChangeRegistry` that Room doesn't know how to handle, because of the `private transient PropertyChangeRegistry mCallbacks` on BaseObservable.
I can bodge this be defining a stub TypeConverter and adding a dummy getter/setter, but that's pretty nasty.
I feel that transient fields should be treated as if they were annotated as @Ignore.